summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt44
-rw-r--r--test/Makefile.am4
-rw-r--r--test/Makefile.in92
-rw-r--r--test/enc_dec_plist.c480
-rw-r--r--test/enc_dec_plist_with_endianess.c160
-rw-r--r--test/enum.c102
-rw-r--r--test/gen_plist.c435
-rw-r--r--test/h5test.h1
-rw-r--r--test/links.c87
-rw-r--r--test/mount.c75
-rw-r--r--test/testfiles/plist_files/acpl_bebin0 -> 23 bytes
-rw-r--r--test/testfiles/plist_files/acpl_lebin0 -> 23 bytes
-rw-r--r--test/testfiles/plist_files/dapl_bebin0 -> 136 bytes
-rw-r--r--test/testfiles/plist_files/dapl_lebin0 -> 136 bytes
-rw-r--r--test/testfiles/plist_files/dcpl_bebin0 -> 221 bytes
-rw-r--r--test/testfiles/plist_files/dcpl_lebin0 -> 221 bytes
-rw-r--r--test/testfiles/plist_files/dxpl_bebin0 -> 229 bytes
-rw-r--r--test/testfiles/plist_files/dxpl_lebin0 -> 229 bytes
-rw-r--r--test/testfiles/plist_files/fapl_bebin0 -> 1402 bytes
-rw-r--r--test/testfiles/plist_files/fapl_lebin0 -> 1402 bytes
-rw-r--r--test/testfiles/plist_files/fcpl_bebin0 -> 413 bytes
-rw-r--r--test/testfiles/plist_files/fcpl_lebin0 -> 413 bytes
-rw-r--r--test/testfiles/plist_files/gcpl_bebin0 -> 113 bytes
-rw-r--r--test/testfiles/plist_files/gcpl_lebin0 -> 113 bytes
-rw-r--r--test/testfiles/plist_files/lapl_bebin0 -> 1502 bytes
-rw-r--r--test/testfiles/plist_files/lapl_lebin0 -> 1502 bytes
-rw-r--r--test/testfiles/plist_files/lcpl_bebin0 -> 47 bytes
-rw-r--r--test/testfiles/plist_files/lcpl_lebin0 -> 47 bytes
-rw-r--r--test/testfiles/plist_files/ocpl_bebin0 -> 86 bytes
-rw-r--r--test/testfiles/plist_files/ocpl_lebin0 -> 86 bytes
-rw-r--r--test/testfiles/plist_files/ocpypl_bebin0 -> 56 bytes
-rw-r--r--test/testfiles/plist_files/ocpypl_lebin0 -> 56 bytes
-rw-r--r--test/testfiles/plist_files/strcpl_bebin0 -> 23 bytes
-rw-r--r--test/testfiles/plist_files/strcpl_lebin0 -> 23 bytes
34 files changed, 1331 insertions, 149 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 8e63326..5551fa3 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -78,6 +78,47 @@ FOREACH (ref_file ${HDF5_REFERENCE_FILES})
ENDFOREACH (ref_file ${HDF5_REFERENCE_FILES})
# --------------------------------------------------------------------
+# Copy test files from test/testfiles/plist_files dir to test dir
+# --------------------------------------------------------------------
+SET (HDF5_REFERENCE_PLIST_FILES
+ acpl_be
+ acpl_le
+ dapl_be
+ dapl_le
+ dcpl_be
+ dcpl_le
+ dxpl_be
+ dxpl_le
+ fapl_be
+ fapl_le
+ fcpl_be
+ fcpl_le
+ gcpl_be
+ gcpl_le
+ lapl_be
+ lapl_le
+ lcpl_be
+ lcpl_le
+ ocpl_be
+ ocpl_le
+ ocpypl_be
+ ocpypl_le
+ strcpl_be
+ strcpl_le
+)
+
+FOREACH (plistfile ${HDF5_REFERENCE_PLIST_FILES})
+ SET (dest "${PROJECT_BINARY_DIR}/${plistfile}")
+ #MESSAGE (STATUS " Copying ${plistfile} to ${dset}")
+ ADD_CUSTOM_COMMAND (
+ TARGET ${HDF5_TEST_LIB_TARGET}
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different ${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile} ${dest}
+ )
+ENDFOREACH (plistfile ${HDF5_REFERENCE_PLIST_FILES})
+
+# --------------------------------------------------------------------
#-- Copy all the HDF5 files from the test directory into the source directory
# --------------------------------------------------------------------
SET (HDF5_REFERENCE_TEST_FILES
@@ -314,6 +355,8 @@ SET (H5_TESTS
testmeta
#links_env
file_image
+ enc_dec_plist
+ enc_dec_plist_with_endianess
)
FOREACH (test ${H5_TESTS})
@@ -638,6 +681,7 @@ IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
gen_specmetaread
gen_sizes_lheap
gen_file_image
+ gen_plist
)
FOREACH (gen ${H5_GENERATORS})
diff --git a/test/Makefile.am b/test/Makefile.am
index 244bb28..a522f9d 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -41,7 +41,7 @@ TEST_PROG= testhdf5 lheap ohdr stab gheap cache cache_api cache_tagging \
pool accum hyperslab istore bittests dt_arith \
dtypes dsets cmpd_dset filter_fail extend external efc objcopy links unlink \
big mtime fillval mount flush1 flush2 app_ref enum \
- set_extent ttsafe \
+ set_extent ttsafe enc_dec_plist enc_dec_plist_with_endianess\
getname vfd ntypes dangle dtransform reserved cross_read \
freespace mf farray earray btree2 fheap file_image
@@ -68,7 +68,7 @@ check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version testmeta links_
BUILD_ALL_PROGS=gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_idx gen_new_array \
gen_new_fill gen_new_group gen_new_mtime gen_new_super gen_noencoder \
gen_nullspace gen_udlinks space_overflow gen_filespace gen_specmetaread \
- gen_sizes_lheap gen_file_image
+ gen_sizes_lheap gen_file_image gen_plist
if BUILD_ALL_CONDITIONAL
noinst_PROGRAMS=$(BUILD_ALL_PROGS)
diff --git a/test/Makefile.in b/test/Makefile.in
index 721bc87..13b07ba 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -115,11 +115,12 @@ am__EXEEXT_1 = testhdf5$(EXEEXT) lheap$(EXEEXT) ohdr$(EXEEXT) \
unlink$(EXEEXT) big$(EXEEXT) mtime$(EXEEXT) fillval$(EXEEXT) \
mount$(EXEEXT) flush1$(EXEEXT) flush2$(EXEEXT) \
app_ref$(EXEEXT) enum$(EXEEXT) set_extent$(EXEEXT) \
- ttsafe$(EXEEXT) getname$(EXEEXT) vfd$(EXEEXT) ntypes$(EXEEXT) \
- dangle$(EXEEXT) dtransform$(EXEEXT) reserved$(EXEEXT) \
- cross_read$(EXEEXT) freespace$(EXEEXT) mf$(EXEEXT) \
- farray$(EXEEXT) earray$(EXEEXT) btree2$(EXEEXT) fheap$(EXEEXT) \
- file_image$(EXEEXT)
+ ttsafe$(EXEEXT) enc_dec_plist$(EXEEXT) \
+ enc_dec_plist_with_endianess$(EXEEXT) getname$(EXEEXT) \
+ vfd$(EXEEXT) ntypes$(EXEEXT) dangle$(EXEEXT) \
+ dtransform$(EXEEXT) reserved$(EXEEXT) cross_read$(EXEEXT) \
+ freespace$(EXEEXT) mf$(EXEEXT) farray$(EXEEXT) earray$(EXEEXT) \
+ btree2$(EXEEXT) fheap$(EXEEXT) file_image$(EXEEXT)
am__EXEEXT_2 = gen_bad_ohdr$(EXEEXT) gen_bogus$(EXEEXT) \
gen_cross$(EXEEXT) gen_deflate$(EXEEXT) gen_filters$(EXEEXT) \
gen_idx$(EXEEXT) gen_new_array$(EXEEXT) gen_new_fill$(EXEEXT) \
@@ -128,7 +129,7 @@ am__EXEEXT_2 = gen_bad_ohdr$(EXEEXT) gen_bogus$(EXEEXT) \
gen_nullspace$(EXEEXT) gen_udlinks$(EXEEXT) \
space_overflow$(EXEEXT) gen_filespace$(EXEEXT) \
gen_specmetaread$(EXEEXT) gen_sizes_lheap$(EXEEXT) \
- gen_file_image$(EXEEXT)
+ gen_file_image$(EXEEXT) gen_plist$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
accum_SOURCES = accum.c
accum_OBJECTS = accum.$(OBJEXT)
@@ -198,6 +199,15 @@ efc_SOURCES = efc.c
efc_OBJECTS = efc.$(OBJEXT)
efc_LDADD = $(LDADD)
efc_DEPENDENCIES = libh5test.la $(LIBHDF5)
+enc_dec_plist_SOURCES = enc_dec_plist.c
+enc_dec_plist_OBJECTS = enc_dec_plist.$(OBJEXT)
+enc_dec_plist_LDADD = $(LDADD)
+enc_dec_plist_DEPENDENCIES = libh5test.la $(LIBHDF5)
+enc_dec_plist_with_endianess_SOURCES = enc_dec_plist_with_endianess.c
+enc_dec_plist_with_endianess_OBJECTS = \
+ enc_dec_plist_with_endianess.$(OBJEXT)
+enc_dec_plist_with_endianess_LDADD = $(LDADD)
+enc_dec_plist_with_endianess_DEPENDENCIES = libh5test.la $(LIBHDF5)
enum_SOURCES = enum.c
enum_OBJECTS = enum.$(OBJEXT)
enum_LDADD = $(LDADD)
@@ -314,6 +324,10 @@ gen_nullspace_SOURCES = gen_nullspace.c
gen_nullspace_OBJECTS = gen_nullspace.$(OBJEXT)
gen_nullspace_LDADD = $(LDADD)
gen_nullspace_DEPENDENCIES = libh5test.la $(LIBHDF5)
+gen_plist_SOURCES = gen_plist.c
+gen_plist_OBJECTS = gen_plist.$(OBJEXT)
+gen_plist_LDADD = $(LDADD)
+gen_plist_DEPENDENCIES = libh5test.la $(LIBHDF5)
gen_sizes_lheap_SOURCES = gen_sizes_lheap.c
gen_sizes_lheap_OBJECTS = gen_sizes_lheap.$(OBJEXT)
gen_sizes_lheap_LDADD = $(LDADD)
@@ -501,40 +515,42 @@ am__v_CCLD_1 =
SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c bittests.c \
btree2.c cache.c cache_api.c cache_tagging.c cmpd_dset.c \
cross_read.c dangle.c dsets.c dt_arith.c dtransform.c dtypes.c \
- earray.c efc.c enum.c err_compat.c error_test.c extend.c \
- external.c farray.c fheap.c file_image.c fillval.c \
- filter_fail.c flush1.c flush2.c flushrefresh.c freespace.c \
- gen_bad_ohdr.c gen_bogus.c gen_cross.c gen_deflate.c \
- gen_file_image.c gen_filespace.c gen_filters.c gen_idx.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_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 pool.c reserved.c \
- set_extent.c space_overflow.c stab.c swmr_addrem_writer.c \
- swmr_generator.c swmr_reader.c swmr_remove_reader.c \
- swmr_remove_writer.c swmr_sparse_reader.c swmr_sparse_writer.c \
- swmr_writer.c tcheck_version.c $(testhdf5_SOURCES) testmeta.c \
+ earray.c efc.c enc_dec_plist.c enc_dec_plist_with_endianess.c \
+ enum.c err_compat.c error_test.c extend.c external.c farray.c \
+ fheap.c file_image.c fillval.c filter_fail.c flush1.c flush2.c \
+ flushrefresh.c freespace.c gen_bad_ohdr.c gen_bogus.c \
+ gen_cross.c gen_deflate.c gen_file_image.c gen_filespace.c \
+ gen_filters.c gen_idx.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 pool.c reserved.c set_extent.c \
+ space_overflow.c stab.c swmr_addrem_writer.c swmr_generator.c \
+ swmr_reader.c swmr_remove_reader.c swmr_remove_writer.c \
+ swmr_sparse_reader.c swmr_sparse_writer.c swmr_writer.c \
+ tcheck_version.c $(testhdf5_SOURCES) testmeta.c \
$(ttsafe_SOURCES) unlink.c vfd.c
DIST_SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c \
bittests.c btree2.c cache.c cache_api.c cache_tagging.c \
cmpd_dset.c cross_read.c dangle.c dsets.c dt_arith.c \
- dtransform.c dtypes.c earray.c efc.c enum.c err_compat.c \
+ dtransform.c dtypes.c earray.c efc.c enc_dec_plist.c \
+ enc_dec_plist_with_endianess.c enum.c err_compat.c \
error_test.c extend.c external.c farray.c fheap.c file_image.c \
fillval.c filter_fail.c flush1.c flush2.c flushrefresh.c \
freespace.c gen_bad_ohdr.c gen_bogus.c gen_cross.c \
gen_deflate.c gen_file_image.c gen_filespace.c gen_filters.c \
gen_idx.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_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 pool.c reserved.c set_extent.c space_overflow.c stab.c \
- swmr_addrem_writer.c swmr_generator.c swmr_reader.c \
- swmr_remove_reader.c swmr_remove_writer.c swmr_sparse_reader.c \
- swmr_sparse_writer.c swmr_writer.c tcheck_version.c \
- $(testhdf5_SOURCES) testmeta.c $(ttsafe_SOURCES) unlink.c \
- vfd.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 pool.c reserved.c set_extent.c \
+ space_overflow.c stab.c swmr_addrem_writer.c swmr_generator.c \
+ swmr_reader.c swmr_remove_reader.c swmr_remove_writer.c \
+ swmr_sparse_reader.c swmr_sparse_writer.c swmr_writer.c \
+ tcheck_version.c $(testhdf5_SOURCES) testmeta.c \
+ $(ttsafe_SOURCES) unlink.c vfd.c
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -880,7 +896,7 @@ TEST_PROG = testhdf5 lheap ohdr stab gheap cache cache_api cache_tagging \
pool accum hyperslab istore bittests dt_arith \
dtypes dsets cmpd_dset filter_fail extend external efc objcopy links unlink \
big mtime fillval mount flush1 flush2 app_ref enum \
- set_extent ttsafe \
+ set_extent ttsafe enc_dec_plist enc_dec_plist_with_endianess\
getname vfd ntypes dangle dtransform reserved cross_read \
freespace mf farray earray btree2 fheap file_image
@@ -895,7 +911,7 @@ TEST_PROG = testhdf5 lheap ohdr stab gheap cache cache_api cache_tagging \
BUILD_ALL_PROGS = gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_idx gen_new_array \
gen_new_fill gen_new_group gen_new_mtime gen_new_super gen_noencoder \
gen_nullspace gen_udlinks space_overflow gen_filespace gen_specmetaread \
- gen_sizes_lheap gen_file_image
+ gen_sizes_lheap gen_file_image gen_plist
# The libh5test library provides common support code for the tests.
@@ -1118,6 +1134,12 @@ earray$(EXEEXT): $(earray_OBJECTS) $(earray_DEPENDENCIES) $(EXTRA_earray_DEPENDE
efc$(EXEEXT): $(efc_OBJECTS) $(efc_DEPENDENCIES) $(EXTRA_efc_DEPENDENCIES)
@rm -f efc$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(efc_OBJECTS) $(efc_LDADD) $(LIBS)
+enc_dec_plist$(EXEEXT): $(enc_dec_plist_OBJECTS) $(enc_dec_plist_DEPENDENCIES) $(EXTRA_enc_dec_plist_DEPENDENCIES)
+ @rm -f enc_dec_plist$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(enc_dec_plist_OBJECTS) $(enc_dec_plist_LDADD) $(LIBS)
+enc_dec_plist_with_endianess$(EXEEXT): $(enc_dec_plist_with_endianess_OBJECTS) $(enc_dec_plist_with_endianess_DEPENDENCIES) $(EXTRA_enc_dec_plist_with_endianess_DEPENDENCIES)
+ @rm -f enc_dec_plist_with_endianess$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(enc_dec_plist_with_endianess_OBJECTS) $(enc_dec_plist_with_endianess_LDADD) $(LIBS)
enum$(EXEEXT): $(enum_OBJECTS) $(enum_DEPENDENCIES) $(EXTRA_enum_DEPENDENCIES)
@rm -f enum$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(enum_OBJECTS) $(enum_LDADD) $(LIBS)
@@ -1205,6 +1227,9 @@ gen_noencoder$(EXEEXT): $(gen_noencoder_OBJECTS) $(gen_noencoder_DEPENDENCIES) $
gen_nullspace$(EXEEXT): $(gen_nullspace_OBJECTS) $(gen_nullspace_DEPENDENCIES) $(EXTRA_gen_nullspace_DEPENDENCIES)
@rm -f gen_nullspace$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(gen_nullspace_OBJECTS) $(gen_nullspace_LDADD) $(LIBS)
+gen_plist$(EXEEXT): $(gen_plist_OBJECTS) $(gen_plist_DEPENDENCIES) $(EXTRA_gen_plist_DEPENDENCIES)
+ @rm -f gen_plist$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(gen_plist_OBJECTS) $(gen_plist_LDADD) $(LIBS)
gen_sizes_lheap$(EXEEXT): $(gen_sizes_lheap_OBJECTS) $(gen_sizes_lheap_DEPENDENCIES) $(EXTRA_gen_sizes_lheap_DEPENDENCIES)
@rm -f gen_sizes_lheap$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(gen_sizes_lheap_OBJECTS) $(gen_sizes_lheap_LDADD) $(LIBS)
@@ -1335,6 +1360,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtypes.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/earray.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/efc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_dec_plist.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enc_dec_plist_with_endianess.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enum.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/err_compat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error_test.Po@am__quote@
@@ -1364,6 +1391,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_new_super.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_noencoder.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_nullspace.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_plist.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_sizes_lheap.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_specmetaread.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_udlinks.Po@am__quote@
diff --git a/test/enc_dec_plist.c b/test/enc_dec_plist.c
new file mode 100644
index 0000000..26bfb84
--- /dev/null
+++ b/test/enc_dec_plist.c
@@ -0,0 +1,480 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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 files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Serial tests for encoding/decoding plists
+ */
+
+#include "h5test.h"
+#include "H5Pprivate.h"
+
+static int
+test_encode_decode(hid_t orig_pl)
+{
+ hid_t pl = (-1); /* Decoded property list */
+ void *temp_buf = NULL; /* Pointer to encoding buffer */
+ size_t temp_size = 0; /* Size of encoding buffer */
+
+ /* first call to encode returns only the size of the buffer needed */
+ if(H5Pencode(orig_pl, NULL, &temp_size) < 0)
+ STACK_ERROR
+
+ if(NULL == (temp_buf = (void *)HDmalloc(temp_size)))
+ TEST_ERROR
+
+ if(H5Pencode(orig_pl, temp_buf, &temp_size) < 0)
+ STACK_ERROR
+
+ if((pl = H5Pdecode(temp_buf)) < 0)
+ STACK_ERROR
+
+ if(!H5Pequal(orig_pl, pl))
+ PUTS_ERROR("encoding-decoding cycle failed\n")
+
+ if((H5Pclose(pl)) < 0)
+ STACK_ERROR
+
+ HDfree(temp_buf);
+
+ /* Success */
+ return(0);
+
+error:
+ if(pl > 0)
+ H5Pclose(pl);
+ if(temp_buf)
+ HDfree(temp_buf);
+
+ 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 */
+ size_t nslots = 521 * 2;
+ size_t nbytes = 1048576 * 10;
+ double w0 = 0.5f;
+ unsigned max_compact;
+ unsigned min_dense;
+ const char* c_to_f = "x+32";
+ H5AC_cache_config_t my_cache_config = {
+ H5AC__CURR_CACHE_CONFIG_VERSION,
+ TRUE,
+ FALSE,
+ FALSE,
+ "temp",
+ TRUE,
+ FALSE,
+ ( 2 * 2048 * 1024),
+ 0.3f,
+ (64 * 1024 * 1024),
+ (4 * 1024 * 1024),
+ 60000,
+ H5C_incr__threshold,
+ 0.8f,
+ 3.0f,
+ TRUE,
+ (8 * 1024 * 1024),
+ H5C_flash_incr__add_space,
+ 2.0f,
+ 0.25f,
+ H5C_decr__age_out_with_threshold,
+ 0.997f,
+ 0.8f,
+ TRUE,
+ (3 * 1024 * 1024),
+ 3,
+ FALSE,
+ 0.2f,
+ (256 * 2048),
+ H5AC__DEFAULT_METADATA_WRITE_STRATEGY};
+
+ if(VERBOSE_MED)
+ printf("Encode/Decode DCPLs\n");
+
+ /******* ENCODE/DECODE DCPLS *****/
+ TESTING("DCPL Encoding/Decoding");
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Pset_chunk(dcpl, 2, &chunk_size)) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE)) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Pset_fill_value(dcpl, H5T_NATIVE_DOUBLE, &fill)) < 0)
+ FAIL_STACK_ERROR
+
+ max_size[0] = 100;
+ 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
+
+ /* 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
+
+ PASSED();
+
+
+ /******* ENCODE/DECODE DAPLS *****/
+ TESTING("DAPL Encoding/Decoding");
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Pset_chunk_cache(dapl, nslots, nbytes, w0)) < 0)
+ FAIL_STACK_ERROR
+
+ /* 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
+
+ PASSED();
+
+
+ /******* ENCODE/DECODE OCPLS *****/
+ TESTING("OCPL Encoding/Decoding");
+ if((ocpl = H5Pcreate(H5P_OBJECT_CREATE)) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Pset_attr_creation_order(ocpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED))) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Pset_attr_phase_change (ocpl, 110, 105)) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Pset_filter (ocpl, H5Z_FILTER_FLETCHER32, 0, (size_t)0, NULL)) < 0)
+ FAIL_STACK_ERROR
+
+ /* 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
+
+ PASSED();
+
+
+ /******* ENCODE/DECODE DXPLS *****/
+ TESTING("DXPL Encoding/Decoding");
+ if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_btree_ratios(dxpl, 0.2f, 0.6f, 0.2f)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_hyper_vector_size(dxpl, 5)) < 0)
+ FAIL_STACK_ERROR
+#ifdef H5_HAVE_PARALLEL
+ if((H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_dxpl_mpio_collective_opt(dxpl, H5FD_MPIO_INDIVIDUAL_IO)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_dxpl_mpio_chunk_opt(dxpl, H5FD_MPIO_CHUNK_MULTI_IO)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_dxpl_mpio_chunk_opt_ratio(dxpl, 30)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_dxpl_mpio_chunk_opt_num(dxpl, 40)) < 0)
+ FAIL_STACK_ERROR
+#endif/* H5_HAVE_PARALLEL */
+ if((H5Pset_edc_check(dxpl, H5Z_DISABLE_EDC)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_data_transform(dxpl, c_to_f)) < 0)
+ FAIL_STACK_ERROR
+
+ /* 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
+
+ PASSED();
+
+
+ /******* ENCODE/DECODE GCPLS *****/
+ TESTING("GCPL Encoding/Decoding");
+ if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Pset_local_heap_size_hint(gcpl, 256)) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Pset_link_phase_change(gcpl, 2, 2)) < 0)
+ FAIL_STACK_ERROR
+
+ /* Query the group creation properties */
+ if((H5Pget_link_phase_change(gcpl, &max_compact, &min_dense)) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Pset_est_link_info(gcpl, 3, 9)) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Pset_link_creation_order(gcpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED))) < 0)
+ FAIL_STACK_ERROR
+
+ /* 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
+
+ PASSED();
+
+
+ /******* ENCODE/DECODE LCPLS *****/
+ TESTING("LCPL Encoding/Decoding");
+ if((lcpl = H5Pcreate(H5P_LINK_CREATE)) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Pset_create_intermediate_group(lcpl, TRUE)) < 0)
+ FAIL_STACK_ERROR
+
+ /* 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
+
+ PASSED();
+
+
+ /******* ENCODE/DECODE LAPLS *****/
+ TESTING("LAPL Encoding/Decoding");
+ if((lapl = H5Pcreate(H5P_LINK_ACCESS)) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Pset_nlinks(lapl, (size_t)134)) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Pset_elink_acc_flags(lapl, H5F_ACC_RDONLY)) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Pset_elink_prefix(lapl, "/tmpasodiasod")) < 0)
+ FAIL_STACK_ERROR
+
+ /* Create FAPL for the elink FAPL */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_alignment(fapl, 2, 1024)) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Pset_elink_fapl(lapl, fapl)) < 0)
+ FAIL_STACK_ERROR
+
+ /* Close the elink's FAPL */
+ if((H5Pclose(fapl)) < 0)
+ FAIL_STACK_ERROR
+
+ /* 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
+
+ PASSED();
+
+
+ /******* ENCODE/DECODE OCPYPLS *****/
+ TESTING("OCPYPL Encoding/Decoding");
+ if((ocpypl = H5Pcreate(H5P_OBJECT_COPY)) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Pset_copy_object(ocpypl, H5O_COPY_EXPAND_EXT_LINK_FLAG)) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Padd_merge_committed_dtype_path(ocpypl, "foo")) < 0)
+ FAIL_STACK_ERROR
+ if((H5Padd_merge_committed_dtype_path(ocpypl, "bar")) < 0)
+ FAIL_STACK_ERROR
+
+ /* 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
+
+ PASSED();
+
+
+ /******* ENCODE/DECODE FAPLS *****/
+ TESTING("FAPL Encoding/Decoding");
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Pset_family_offset(fapl, 1024)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_meta_block_size(fapl, 2098452)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_sieve_buf_size(fapl, 1048576)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_alignment(fapl, 2, 1024)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_cache(fapl, 1024, 128, 10485760, 0.3f)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_elink_file_cache_size(fapl, 10485760)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_gc_references(fapl, 1)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_small_data_block_size(fapl, 2048)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_fclose_degree(fapl, H5F_CLOSE_WEAK)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_multi_type(fapl, H5FD_MEM_GHEAP)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pset_mdc_config(fapl, &my_cache_config)) < 0)
+ FAIL_STACK_ERROR
+
+ /* 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
+
+ PASSED();
+
+
+ /******* ENCODE/DECODE FCPLS *****/
+ TESTING("FCPL Encoding/Decoding");
+
+ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Pset_userblock(fcpl, 1024) < 0))
+ FAIL_STACK_ERROR
+
+ if((H5Pset_istore_k(fcpl, 3) < 0))
+ FAIL_STACK_ERROR
+
+ if((H5Pset_sym_k(fcpl, 4, 5) < 0))
+ FAIL_STACK_ERROR
+
+ if((H5Pset_shared_mesg_nindexes(fcpl, 8) < 0))
+ FAIL_STACK_ERROR
+
+ if((H5Pset_shared_mesg_index(fcpl, 1, H5O_SHMESG_SDSPACE_FLAG, 32) < 0))
+ FAIL_STACK_ERROR
+
+ if((H5Pset_shared_mesg_phase_change(fcpl, 60, 20) < 0))
+ FAIL_STACK_ERROR
+
+ if((H5Pset_sizes(fcpl, 8, 4) < 0))
+ FAIL_STACK_ERROR
+
+ /* 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
+
+ PASSED();
+
+
+ /******* ENCODE/DECODE STRCPLS *****/
+ TESTING("STRCPL Encoding/Decoding");
+
+ if((strcpl = H5Pcreate(H5P_STRING_CREATE)) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Pset_char_encoding(strcpl, H5T_CSET_UTF8) < 0))
+ FAIL_STACK_ERROR
+
+ /* 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
+
+ PASSED();
+
+
+ /******* ENCODE/DECODE ACPLS *****/
+ TESTING("ACPL Encoding/Decoding");
+
+ if((acpl = H5Pcreate(H5P_ATTRIBUTE_CREATE)) < 0)
+ FAIL_STACK_ERROR
+
+ if((H5Pset_char_encoding(acpl, H5T_CSET_UTF8) < 0))
+ FAIL_STACK_ERROR
+
+ /* 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
+
+ PASSED();
+
+
+ return 0;
+
+error:
+ printf("***** Plist Encode/Decode tests FAILED! *****\n");
+ return 1;
+}
+
diff --git a/test/enc_dec_plist_with_endianess.c b/test/enc_dec_plist_with_endianess.c
new file mode 100644
index 0000000..4469604
--- /dev/null
+++ b/test/enc_dec_plist_with_endianess.c
@@ -0,0 +1,160 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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 files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Serial tests for encoding/decoding plists
+ */
+
+#include "h5test.h"
+#include "H5srcdir.h"
+
+static int test_plists(const char *filename1, const char *filename2);
+
+int
+main(void)
+{
+ if(VERBOSE_MED)
+ printf("Encode/Decode property list endianess\n");
+
+ /******* ENCODE/DECODE DCPLS *****/
+ TESTING("DCPL Encoding/Decoding");
+ if(test_plists("testfiles/plist_files/dcpl_le", "testfiles/plist_files/dcpl_be") < 0)
+ FAIL_STACK_ERROR
+ PASSED();
+
+ /******* ENCODE/DECODE DAPLS *****/
+ TESTING("DAPL Encoding/Decoding");
+ if(test_plists("testfiles/plist_files/dapl_le", "testfiles/plist_files/dapl_be") < 0)
+ FAIL_STACK_ERROR
+ PASSED();
+
+ /******* ENCODE/DECODE DXPLS *****/
+ TESTING("DXPL Encoding/Decoding");
+ if(test_plists("testfiles/plist_files/dxpl_le", "testfiles/plist_files/dxpl_be") < 0)
+ FAIL_STACK_ERROR
+ PASSED();
+
+ /******* ENCODE/DECODE GCPLS *****/
+ TESTING("GCPL Encoding/Decoding");
+ if(test_plists("testfiles/plist_files/gcpl_le", "testfiles/plist_files/gcpl_be") < 0)
+ FAIL_STACK_ERROR
+ PASSED();
+
+ /******* ENCODE/DECODE LCPLS *****/
+ TESTING("LCPL Encoding/Decoding");
+ if(test_plists("testfiles/plist_files/lcpl_le", "testfiles/plist_files/lcpl_be") < 0)
+ FAIL_STACK_ERROR
+ PASSED();
+
+ /******* ENCODE/DECODE LAPLS *****/
+ TESTING("LAPL Encoding/Decoding");
+ if(test_plists("testfiles/plist_files/lapl_le", "testfiles/plist_files/lapl_be") < 0)
+ FAIL_STACK_ERROR
+ PASSED();
+
+ /******* ENCODE/DECODE OCPLS *****/
+ TESTING("OCPL Encoding/Decoding");
+ if(test_plists("testfiles/plist_files/ocpl_le", "testfiles/plist_files/ocpl_be") < 0)
+ FAIL_STACK_ERROR
+ PASSED();
+
+ /******* ENCODE/DECODE OCPYPLS *****/
+ TESTING("OCPYPL Encoding/Decoding");
+ if(test_plists("testfiles/plist_files/ocpypl_le", "testfiles/plist_files/ocpypl_be") < 0)
+ FAIL_STACK_ERROR
+ PASSED();
+
+ /******* ENCODE/DECODE FCPLS *****/
+ TESTING("FCPL Encoding/Decoding");
+ if(test_plists("testfiles/plist_files/fcpl_le", "testfiles/plist_files/fcpl_be") < 0)
+ FAIL_STACK_ERROR
+ PASSED();
+
+ /******* ENCODE/DECODE FAPLS *****/
+ TESTING("FAPL Encoding/Decoding");
+ if(test_plists("testfiles/plist_files/fapl_le", "testfiles/plist_files/fapl_be") < 0)
+ FAIL_STACK_ERROR
+ PASSED();
+
+ /******* ENCODE/DECODE STRCPLS *****/
+ TESTING("STRCPL Encoding/Decoding");
+ if(test_plists("testfiles/plist_files/strcpl_le", "testfiles/plist_files/strcpl_be") < 0)
+ FAIL_STACK_ERROR
+ PASSED();
+
+ /******* ENCODE/DECODE ACPLS *****/
+ TESTING("ACPL Encoding/Decoding");
+ if(test_plists("testfiles/plist_files/acpl_le", "testfiles/plist_files/acpl_be") < 0)
+ FAIL_STACK_ERROR
+ PASSED();
+
+ return 0;
+
+error:
+ return 1;
+}
+
+static int
+test_plists(const char *filename1, const char *filename2)
+{
+ int fd_le, fd_be;
+ size_t size_le = 0, size_be = 0;
+ void *buf_le = NULL, *buf_be = NULL;
+ hid_t plist_le, plist_be; /* dataset create prop. list */
+ const char *testfile;
+
+ testfile = H5_get_srcdir_filename(filename1);
+ if((fd_le = HDopen(testfile, O_RDONLY, 0666)) < 0)
+ TEST_ERROR
+ size_le = HDlseek(fd_le, (HDoff_t)0, SEEK_END);
+ HDlseek(fd_le, (HDoff_t)0, SEEK_SET);
+ buf_le = (void *)HDmalloc(size_le);
+ if(HDread(fd_le, buf_le, size_le) < 0)
+ TEST_ERROR
+ HDclose(fd_le);
+
+ testfile = H5_get_srcdir_filename(filename2);
+ if((fd_be = HDopen(testfile, O_RDONLY, 0666)) < 0)
+ TEST_ERROR
+ size_be = HDlseek(fd_be, (HDoff_t)0, SEEK_END);
+ HDlseek(fd_be, (HDoff_t)0, SEEK_SET);
+ buf_be = (void *)HDmalloc(size_be);
+ if(HDread(fd_be, buf_be, size_be) < 0)
+ TEST_ERROR
+ HDclose(fd_be);
+
+ if((plist_le = H5Pdecode(buf_le)) < 0)
+ FAIL_STACK_ERROR
+ if((plist_be = H5Pdecode(buf_be)) < 0)
+ FAIL_STACK_ERROR
+
+ if(!H5Pequal(plist_le, plist_be))
+ FAIL_PUTS_ERROR("PLIST encoding/decoding comparison failed\n")
+
+ if((H5Pclose(plist_le)) < 0)
+ FAIL_STACK_ERROR
+ if((H5Pclose(plist_be)) < 0)
+ FAIL_STACK_ERROR
+
+ HDfree(buf_le);
+ HDfree(buf_be);
+
+ return 1;
+
+error:
+ printf("***** Plist Encode/Decode tests FAILED! *****\n");
+ return -1;
+}
+
diff --git a/test/enum.c b/test/enum.c
index 3684102..29b702d 100644
--- a/test/enum.c
+++ b/test/enum.c
@@ -109,9 +109,9 @@ test_named(hid_t file)
/*-------------------------------------------------------------------------
- * Function: test_noconv
+ * Function: test_conv
*
- * Purpose: Tests creation of datasets when no conversion is present.
+ * Purpose: Tests writing and read data
*
* Return: Success: 0
*
@@ -119,24 +119,32 @@ test_named(hid_t file)
*
* Programmer: Robb Matzke
* Monday, January 4, 1999
+ *
+ * Raymond Lu
+ * 12 October 2012
+ * I added tests for enum-integer and enum-float conversions
*-------------------------------------------------------------------------
*/
static int
-test_noconv(hid_t file)
+test_conv(hid_t file)
{
hid_t cwg=-1, type=-1, space=-1, dset=-1;
c_e1 val;
+ /* Some values are out of range for testing. The library should accept them */
static c_e1 data1[]={E1_RED, E1_GREEN, E1_BLUE, E1_GREEN, E1_WHITE,
E1_WHITE, E1_BLACK, E1_GREEN, E1_BLUE, E1_RED,
E1_RED, E1_BLUE, E1_GREEN, E1_BLACK, E1_WHITE,
- E1_RED, E1_WHITE, E1_GREEN, E1_GREEN, E1_BLUE};
+ E1_RED, E1_WHITE, (c_e1)0, (c_e1)-1, (c_e1)-2};
c_e1 data2[NELMTS(data1)];
+ short data_short[NELMTS(data1)];
+ int data_int[NELMTS(data1)];
+ double data_double[NELMTS(data1)];
hsize_t ds_size[1]={NELMTS(data1)};
size_t i;
- TESTING("no-conversion datasets");
+ TESTING("enumeration conversions");
- if((cwg = H5Gcreate2(file, "test_noconv", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((cwg = H5Gcreate2(file, "test_conv", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if((type = H5Tcreate(H5T_ENUM, sizeof(c_e1))) < 0) FAIL_STACK_ERROR
if(H5Tenum_insert(type, "RED", CPTR(val, E1_RED )) < 0) FAIL_STACK_ERROR
@@ -146,20 +154,96 @@ test_noconv(hid_t file)
if(H5Tenum_insert(type, "BLACK", CPTR(val, E1_BLACK)) < 0) FAIL_STACK_ERROR
if((space = H5Screate_simple(1, ds_size, NULL)) < 0) FAIL_STACK_ERROR
- if((dset = H5Dcreate2(cwg, "color_table", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+
+ /***************************************
+ * Dataset of enumeration type
+ ***************************************/
+ /* Create a dataset of enum type and write enum data to it */
+ if((dset = H5Dcreate2(cwg, "color_table1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(H5Dwrite(dset, type, space, space, H5P_DEFAULT, data1) < 0) FAIL_STACK_ERROR
+
+ /* Test reading back the data with no conversion */
if(H5Dread(dset, type, space, space, H5P_DEFAULT, data2) < 0) FAIL_STACK_ERROR
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",
+ printf(" 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;
} /* end if */
+ /* Test converting the data to integer. Read enum data back as integer */
+ if(H5Dread(dset, H5T_NATIVE_SHORT, space, space, H5P_DEFAULT, data_short) < 0) FAIL_STACK_ERROR
+
+ 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",
+ (unsigned long)i, (int)(data1[i]),
+ (unsigned long)i, (int)(data_short[i]));
+ goto error;
+ } /* end if */
+
+ /* Test converting the data to floating number. Read enum data back as floating number */
+ if(H5Dread(dset, H5T_NATIVE_DOUBLE, space, space, H5P_DEFAULT, data_double) < 0) FAIL_STACK_ERROR
+
+ 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",
+ (unsigned long)i, (int)(data1[i]),
+ (unsigned long)i, (int)(data_double[i]));
+ goto error;
+ } /* end if */
+
+ if(H5Dclose(dset) < 0) FAIL_STACK_ERROR
+
+ /***************************************
+ * Dataset of integer type
+ ***************************************/
+ /* Create a dataset of native integer and write enum data to it */
+ if((dset = H5Dcreate2(cwg, "color_table2", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+
+ if(H5Dwrite(dset, type, space, space, H5P_DEFAULT, data1) < 0) FAIL_STACK_ERROR
+
+ /* Test reading back the data with no conversion */
+ if(H5Dread(dset, H5T_NATIVE_INT, space, space, H5P_DEFAULT, data_int) < 0) FAIL_STACK_ERROR
+
+ 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",
+ (unsigned long)i, (int)(data1[i]),
+ (unsigned long)i, (int)(data_int[i]));
+ goto error;
+ } /* end if */
+
if(H5Dclose(dset) < 0) FAIL_STACK_ERROR
+
+ /***************************************
+ * Dataset of double type
+ ***************************************/
+ /* Create a dataset of native double and write enum data to it */
+ if((dset = H5Dcreate2(cwg, "color_table3", H5T_NATIVE_DOUBLE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+
+ if(H5Dwrite(dset, type, space, space, H5P_DEFAULT, data1) < 0) FAIL_STACK_ERROR
+
+ /* Test reading back the data with no conversion */
+ if(H5Dread(dset, H5T_NATIVE_DOUBLE, space, space, H5P_DEFAULT, data_double) < 0) FAIL_STACK_ERROR
+
+ 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",
+ (unsigned long)i, (int)(data1[i]),
+ (unsigned long)i, (int)(data_double[i]));
+ goto error;
+ } /* end if */
+
+ if(H5Dclose(dset) < 0) FAIL_STACK_ERROR
+
if(H5Sclose(space) < 0) FAIL_STACK_ERROR
if(H5Tclose(type) < 0) FAIL_STACK_ERROR
if(H5Gclose(cwg) < 0) FAIL_STACK_ERROR
@@ -572,7 +656,7 @@ main(void)
/* Tests */
nerrors += test_named(file);
- nerrors += test_noconv(file);
+ nerrors += test_conv(file);
nerrors += test_tr1(file);
nerrors += test_tr2(file);
nerrors += test_value_dsnt_exist();
diff --git a/test/gen_plist.c b/test/gen_plist.c
new file mode 100644
index 0000000..b4da261
--- /dev/null
+++ b/test/gen_plist.c
@@ -0,0 +1,435 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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 files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * generate plist file
+ */
+
+#include <assert.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include "H5private.h"
+#include "hdf5.h"
+
+static int encode_plist(hid_t plist_id, int little_endian, const char *filename_le, const char *filename_be);
+
+int
+main(void)
+{
+ hid_t dcpl1; /* dataset create prop. list */
+ hid_t dapl1; /* dataset access prop. list */
+ hid_t dxpl1; /* dataset xfer prop. list */
+ hid_t gcpl1; /* group create prop. list */
+ hid_t ocpypl1; /* object copy prop. list */
+ hid_t ocpl1; /* object create prop. list */
+ hid_t lcpl1; /* link create prop. list */
+ hid_t lapl1; /* link access prop. list */
+ hid_t fapl1; /* file access prop. list */
+ hid_t fcpl1; /* file create prop. list */
+ hid_t strcpl1; /* string create prop. list */
+ hid_t acpl1; /* attribute create prop. list */
+
+ herr_t ret = 0;
+ hsize_t chunk_size = 16384; /* chunk size */
+ int fill = 2; /* 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;
+ unsigned max_compact;
+ unsigned min_dense;
+ const char* c_to_f = "x+32";
+ int little_endian;
+ H5AC_cache_config_t my_cache_config = {
+ H5AC__CURR_CACHE_CONFIG_VERSION,
+ 1 /*TRUE*/,
+ 0 /*FALSE*/,
+ 0 /*FALSE*/,
+ "temp",
+ 1 /*TRUE*/,
+ 0 /*FALSE*/,
+ ( 2 * 2048 * 1024),
+ 0.3f,
+ (64 * 1024 * 1024),
+ (4 * 1024 * 1024),
+ 60000,
+ H5C_incr__threshold,
+ 0.8f,
+ 3.0f,
+ 1 /*TRUE*/,
+ (8 * 1024 * 1024),
+ H5C_flash_incr__add_space,
+ 2.0f,
+ 0.25f,
+ H5C_decr__age_out_with_threshold,
+ 0.997f,
+ 0.8f,
+ 1 /*TRUE*/,
+ (3 * 1024 * 1024),
+ 3,
+ 0 /*FALSE*/,
+ 0.2f,
+ (256 * 2048),
+ H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY};
+
+ /* check endianess */
+ {
+ short int word = 0x0001;
+ char *byte = (char *) &word;
+
+ if(byte[0] == 1)
+ /* little endian */
+ little_endian = 1;
+ else
+ /* big endian */
+ little_endian = 0;
+ }
+
+ /* Explicitly initialize the library, since we are including the private header file */
+ H5open();
+
+ /******* ENCODE/DECODE DCPLS *****/
+ if((dcpl1 = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ assert(dcpl1 > 0);
+
+ if((ret = H5Pset_chunk(dcpl1, 1, &chunk_size)) < 0)
+ assert(ret > 0);
+
+ if((ret = H5Pset_alloc_time(dcpl1, H5D_ALLOC_TIME_LATE)) < 0)
+ assert(ret > 0);
+
+ ret = H5Tconvert(H5T_NATIVE_INT, H5T_STD_I32BE, (size_t)1, &fill, NULL, H5P_DEFAULT);
+ assert(ret >= 0);
+ if((ret = H5Pset_fill_value(dcpl1, H5T_STD_I32BE, &fill)) < 0)
+ assert(ret > 0);
+
+ max_size[0] = 100;
+ if((ret = H5Pset_external(dcpl1, "ext1.data", (off_t)0,
+ (hsize_t)(max_size[0] * sizeof(int)/4))) < 0)
+ assert(ret > 0);
+ if((ret = H5Pset_external(dcpl1, "ext2.data", (off_t)0,
+ (hsize_t)(max_size[0] * sizeof(int)/4))) < 0)
+ assert(ret > 0);
+ if((ret = H5Pset_external(dcpl1, "ext3.data", (off_t)0,
+ (hsize_t)(max_size[0] * sizeof(int)/4))) < 0)
+ assert(ret > 0);
+ if((ret = H5Pset_external(dcpl1, "ext4.data", (off_t)0,
+ (hsize_t)(max_size[0] * sizeof(int)/4))) < 0)
+ assert(ret > 0);
+
+ if((ret = encode_plist(dcpl1, little_endian, "testfiles/plist_files/dcpl_le", "testfiles/plist_files/dcpl_be")) < 0)
+ assert(ret > 0);
+
+ /* release resource */
+ if((ret = H5Pclose(dcpl1)) < 0)
+ assert(ret > 0);
+
+
+ /******* ENCODE/DECODE DAPLS *****/
+ if((dapl1 = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ assert(dapl1 > 0);
+
+ if((ret = H5Pset_chunk_cache(dapl1, nslots, nbytes, w0)) < 0)
+ assert(ret > 0);
+
+ if((ret = encode_plist(dapl1, little_endian, "testfiles/plist_files/dapl_le", "testfiles/plist_files/dapl_be")) < 0)
+ assert(ret > 0);
+
+ /* release resource */
+ if((ret = H5Pclose(dapl1)) < 0)
+ assert(ret > 0);
+
+ /******* ENCODE/DECODE DXPLS *****/
+ if((dxpl1 = H5Pcreate(H5P_DATASET_XFER)) < 0)
+ assert(dxpl1 > 0);
+ if((ret = H5Pset_btree_ratios(dxpl1, 0.2f, 0.6f, 0.2f)) < 0)
+ assert(ret > 0);
+ if((ret = H5Pset_hyper_vector_size(dxpl1, 5)) < 0)
+ assert(ret > 0);
+#ifdef H5_HAVE_PARALLEL
+ if((ret = H5Pset_dxpl_mpio(dxpl1, H5FD_MPIO_COLLECTIVE)) < 0)
+ assert(ret > 0);
+ if((ret = H5Pset_dxpl_mpio_collective_opt(dxpl1, H5FD_MPIO_INDIVIDUAL_IO)) < 0)
+ assert(ret > 0);
+ if((ret = H5Pset_dxpl_mpio_chunk_opt(dxpl1, H5FD_MPIO_CHUNK_MULTI_IO)) < 0)
+ assert(ret > 0);
+ if((ret = H5Pset_dxpl_mpio_chunk_opt_ratio(dxpl1, 30)) < 0)
+ assert(ret > 0);
+ if((ret = H5Pset_dxpl_mpio_chunk_opt_num(dxpl1, 40)) < 0)
+ assert(ret > 0);
+#endif/* H5_HAVE_PARALLEL */
+ if((ret = H5Pset_edc_check(dxpl1, H5Z_DISABLE_EDC)) < 0)
+ assert(ret > 0);
+ if((ret = H5Pset_data_transform(dxpl1, c_to_f)) < 0)
+ assert(ret > 0);
+
+ if((ret = encode_plist(dxpl1, little_endian, "testfiles/plist_files/dxpl_le", "testfiles/plist_files/dxpl_be")) < 0)
+ assert(ret > 0);
+
+ /* release resource */
+ if((ret = H5Pclose(dxpl1)) < 0)
+ assert(ret > 0);
+
+
+ /******* ENCODE/DECODE GCPLS *****/
+ if((gcpl1 = H5Pcreate(H5P_GROUP_CREATE)) < 0)
+ assert(gcpl1 > 0);
+
+ if((ret = H5Pset_local_heap_size_hint(gcpl1, 256)) < 0)
+ assert(ret > 0);
+
+ if((ret = H5Pset_link_phase_change(gcpl1, 2, 2)) < 0)
+ assert(ret > 0);
+
+ /* Query the group creation properties */
+ if((ret = H5Pget_link_phase_change(gcpl1, &max_compact, &min_dense)) < 0)
+ assert(ret > 0);
+
+ if((ret = H5Pset_est_link_info(gcpl1, 3, 9)) < 0)
+ assert(ret > 0);
+
+ if((ret = H5Pset_link_creation_order(gcpl1, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED))) < 0)
+ assert(ret > 0);
+
+ if((ret = encode_plist(gcpl1, little_endian, "testfiles/plist_files/gcpl_le", "testfiles/plist_files/gcpl_be")) < 0)
+ assert(ret > 0);
+
+ /* release resource */
+ if((ret = H5Pclose(gcpl1)) < 0)
+ assert(ret > 0);
+
+ /******* ENCODE/DECODE LCPLS *****/
+ if((lcpl1 = H5Pcreate(H5P_LINK_CREATE)) < 0)
+ assert(lcpl1 > 0);
+
+ if((ret = H5Pset_create_intermediate_group(lcpl1, 1 /*TRUE*/)) < 0)
+ assert(ret > 0);
+
+ if((ret = encode_plist(lcpl1, little_endian, "testfiles/plist_files/lcpl_le", "testfiles/plist_files/lcpl_be")) < 0)
+ assert(ret > 0);
+
+ /* release resource */
+ if((ret = H5Pclose(lcpl1)) < 0)
+ assert(ret > 0);
+
+ /******* ENCODE/DECODE OCPYLS *****/
+ if((ocpypl1 = H5Pcreate(H5P_OBJECT_COPY)) < 0)
+ assert(ocpypl1 > 0);
+
+ ret = H5Pset_copy_object(ocpypl1, H5O_COPY_EXPAND_EXT_LINK_FLAG);
+ assert(ret >= 0);
+
+ ret = H5Padd_merge_committed_dtype_path(ocpypl1, "foo");
+ assert(ret >= 0);
+
+ ret = H5Padd_merge_committed_dtype_path(ocpypl1, "bar");
+ assert(ret >= 0);
+
+ if((ret = encode_plist(ocpypl1, little_endian, "testfiles/plist_files/ocpypl_le", "testfiles/plist_files/ocpypl_be")) < 0)
+ assert(ret > 0);
+
+ /* release resource */
+ if((ret = H5Pclose(ocpypl1)) < 0)
+ assert(ret > 0);
+
+ /******* ENCODE/DECODE OCPLS *****/
+ if((ocpl1 = H5Pcreate(H5P_OBJECT_CREATE)) < 0)
+ assert(ocpl1 > 0);
+
+ if((ret = H5Pset_attr_creation_order(ocpl1, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED))) < 0)
+ assert(ret > 0);
+
+ if((ret = H5Pset_attr_phase_change (ocpl1, 110, 105)) < 0)
+ assert(ret > 0);
+
+ if((ret = H5Pset_filter (ocpl1, H5Z_FILTER_FLETCHER32, 0, (size_t)0, NULL)) < 0)
+ assert(ret > 0);
+
+ if((ret = encode_plist(ocpl1, little_endian, "testfiles/plist_files/ocpl_le", "testfiles/plist_files/ocpl_be")) < 0)
+ assert(ret > 0);
+
+ /* release resource */
+ if((ret = H5Pclose(ocpl1)) < 0)
+ assert(ret > 0);
+
+ /******* ENCODE/DECODE LAPLS *****/
+ if((lapl1 = H5Pcreate(H5P_LINK_ACCESS)) < 0)
+ assert(lapl1 > 0);
+
+ if((ret = H5Pset_nlinks(lapl1, (size_t)134)) < 0)
+ assert(ret > 0);
+
+ if((ret = H5Pset_elink_acc_flags(lapl1, H5F_ACC_RDONLY)) < 0)
+ assert(ret > 0);
+
+ if((ret = H5Pset_elink_prefix(lapl1, "/tmpasodiasod")) < 0)
+ assert(ret > 0);
+
+ /* Create FAPL for the elink FAPL */
+ if((fapl1 = ret = H5Pcreate(ret = H5P_FILE_ACCESS)) < 0)
+ assert(ret > 0);
+ if((ret = H5Pset_alignment(fapl1, 2, 1024)) < 0)
+ assert(ret > 0);
+
+ if((ret = H5Pset_elink_fapl(lapl1, fapl1)) < 0)
+ assert(ret > 0);
+
+ /* Close the elink's FAPL */
+ if((ret = H5Pclose(fapl1)) < 0)
+ assert(ret > 0);
+
+ if((ret = encode_plist(lapl1, little_endian, "testfiles/plist_files/lapl_le", "testfiles/plist_files/lapl_be")) < 0)
+ assert(ret > 0);
+
+ /* release resource */
+ if((ret = H5Pclose(lapl1)) < 0)
+ assert(ret > 0);
+
+ /******* ENCODE/DECODE FAPLS *****/
+ if((fapl1 = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ assert(fapl1 > 0);
+
+ if((ret = H5Pset_family_offset(fapl1, 1024)) < 0)
+ assert(ret > 0);
+ if((ret = H5Pset_meta_block_size(fapl1, 2098452)) < 0)
+ assert(ret > 0);
+ if((ret = H5Pset_sieve_buf_size(fapl1, 1048576)) < 0)
+ assert(ret > 0);
+ if((ret = H5Pset_alignment(fapl1, 2, 1024)) < 0)
+ assert(ret > 0);
+ if((ret = H5Pset_cache(fapl1, 1024, 128, 10485760, 0.3f)) < 0)
+ assert(ret > 0);
+ if((ret = H5Pset_elink_file_cache_size(fapl1, 10485760)) < 0)
+ assert(ret > 0);
+ if((ret = H5Pset_gc_references(fapl1, 1)) < 0)
+ assert(ret > 0);
+ if((ret = H5Pset_small_data_block_size(fapl1, 2048)) < 0)
+ assert(ret > 0);
+ if((ret = H5Pset_libver_bounds(fapl1, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST)) < 0)
+ assert(ret > 0);
+ if((ret = H5Pset_fclose_degree(fapl1, H5F_CLOSE_WEAK)) < 0)
+ assert(ret > 0);
+ if((ret = H5Pset_multi_type(fapl1, H5FD_MEM_GHEAP)) < 0)
+ assert(ret > 0);
+ if((ret = H5Pset_mdc_config(fapl1, &my_cache_config)) < 0)
+ assert(ret > 0);
+
+ if((ret = encode_plist(fapl1, little_endian, "testfiles/plist_files/fapl_le", "testfiles/plist_files/fapl_be")) < 0)
+ assert(ret > 0);
+
+ /* release resource */
+ if((ret = H5Pclose(fapl1)) < 0)
+ assert(ret > 0);
+
+ /******* ENCODE/DECODE FCPLS *****/
+ if((fcpl1 = H5Pcreate(H5P_FILE_CREATE)) < 0)
+ assert(fcpl1 > 0);
+
+ if((ret = H5Pset_userblock(fcpl1, 1024) < 0))
+ assert(ret > 0);
+
+ if((ret = H5Pset_istore_k(fcpl1, 3) < 0))
+ assert(ret > 0);
+
+ if((ret = H5Pset_sym_k(fcpl1, 4, 5) < 0))
+ assert(ret > 0);
+
+ if((ret = H5Pset_shared_mesg_nindexes(fcpl1, 8) < 0))
+ assert(ret > 0);
+
+ if((ret = H5Pset_shared_mesg_index(fcpl1, 1, H5O_SHMESG_SDSPACE_FLAG, 32) < 0))
+ assert(ret > 0);
+
+ if((ret = H5Pset_shared_mesg_phase_change(fcpl1, 60, 20) < 0))
+ assert(ret > 0);
+
+ if((ret = H5Pset_sizes(fcpl1, 8, 4) < 0))
+ assert(ret > 0);
+
+ if((ret = encode_plist(fcpl1, little_endian, "testfiles/plist_files/fcpl_le", "testfiles/plist_files/fcpl_be")) < 0)
+ assert(ret > 0);
+
+ /* release resource */
+ if((ret = H5Pclose(fcpl1)) < 0)
+ assert(ret > 0);
+
+ /******* ENCODE/DECODE STRCPLS *****/
+ strcpl1 = H5Pcreate(H5P_STRING_CREATE);
+ assert(strcpl1 > 0);
+
+ ret = H5Pset_char_encoding(strcpl1, H5T_CSET_UTF8);
+ assert(ret >= 0);
+
+ ret = encode_plist(strcpl1, little_endian, "testfiles/plist_files/strcpl_le", "testfiles/plist_files/strcpl_be");
+ assert(ret > 0);
+
+ /* release resource */
+ ret = H5Pclose(strcpl1);
+ assert(ret >= 0);
+
+ /******* ENCODE/DECODE ACPLS *****/
+ acpl1 = H5Pcreate(H5P_ATTRIBUTE_CREATE);
+ assert(acpl1 > 0);
+
+ ret = H5Pset_char_encoding(acpl1, H5T_CSET_UTF8);
+ assert(ret >= 0);
+
+ ret = encode_plist(acpl1, little_endian, "testfiles/plist_files/acpl_le", "testfiles/plist_files/acpl_be");
+ assert(ret > 0);
+
+ /* release resource */
+ ret = H5Pclose(acpl1);
+ assert(ret >= 0);
+
+ return 0;
+}
+
+static int
+encode_plist(hid_t plist_id, int little_endian, const char *filename_le, const char *filename_be)
+{
+ int fd = 0; /* file descriptor */
+ herr_t ret = 0;
+ void *temp_buf = NULL;
+ size_t temp_size = 0;
+ ssize_t write_size;
+
+ /* first call to encode returns only the size of the buffer needed */
+ if((ret = H5Pencode(plist_id, NULL, &temp_size)) < 0)
+ assert(ret > 0);
+
+ temp_buf = (void *)HDmalloc(temp_size);
+ assert(temp_buf);
+
+ if((ret = H5Pencode(plist_id, temp_buf, &temp_size)) < 0)
+ assert(ret > 0);
+
+ if(little_endian)
+ fd = HDopen(filename_le, O_RDWR | O_CREAT | O_TRUNC, 0666);
+ else
+ fd = HDopen(filename_be, O_RDWR | O_CREAT | O_TRUNC, 0666);
+ assert(fd > 0);
+
+ write_size = HDwrite(fd, temp_buf, temp_size);
+ assert(write_size == (ssize_t)temp_size);
+
+ HDclose(fd);
+
+ HDfree(temp_buf);
+
+ return 1;
+}
+
diff --git a/test/h5test.h b/test/h5test.h
index 0c52bd1..7813b51 100644
--- a/test/h5test.h
+++ b/test/h5test.h
@@ -104,6 +104,7 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */
#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 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); \
diff --git a/test/links.c b/test/links.c
index ee635ff..91920d3 100644
--- a/test/links.c
+++ b/test/links.c
@@ -1884,7 +1884,7 @@ external_link_root(hid_t fapl, hbool_t new_format)
/* Check that all file IDs have been closed */
if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR
- if(H5F_sfile_assert_num(0) != 0) TEST_ERROR
+ H5F_sfile_assert_num(0);
/* Open first file again with read-only access and check on objects created */
if((fid = H5Fopen(filename1, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
@@ -1908,7 +1908,7 @@ external_link_root(hid_t fapl, hbool_t new_format)
/* Check that all file IDs have been closed */
if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR
- if(H5F_sfile_assert_num(0) != 0) TEST_ERROR
+ H5F_sfile_assert_num(0);
/* Verify that new objects can't be created through a read-only external
* link.
@@ -1925,7 +1925,7 @@ external_link_root(hid_t fapl, hbool_t new_format)
/* Check that all file IDs have been closed */
if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR
- if(H5F_sfile_assert_num(0) != 0) TEST_ERROR
+ H5F_sfile_assert_num(0);
PASSED();
return 0;
@@ -6823,8 +6823,7 @@ external_file_cache(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Verify that only 1 file is open */
- if(H5F_sfile_assert_num(1) < 0)
- TEST_ERROR
+ H5F_sfile_assert_num(1);
/* Open and close the target of the external link */
if((oid = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0)
@@ -6833,16 +6832,14 @@ external_file_cache(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Verify that both files are now open */
- if(H5F_sfile_assert_num(2) < 0)
- TEST_ERROR
+ H5F_sfile_assert_num(2);
/* Close file 1 */
if(H5Fclose(fid1) < 0)
TEST_ERROR
/* Verify that both files are now closed */
- if(H5F_sfile_assert_num(0) < 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
/*
@@ -6864,8 +6861,7 @@ external_file_cache(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Verify that only 1 file is open */
- if(H5F_sfile_assert_num(1) < 0)
- TEST_ERROR
+ H5F_sfile_assert_num(1);
/* Open and close the target of the external link */
if((oid = H5Oopen(fid1, "link_to_2", H5P_DEFAULT)) < 0)
@@ -6874,24 +6870,21 @@ external_file_cache(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Verify that both files are now open */
- if(H5F_sfile_assert_num(2) < 0)
- TEST_ERROR
+ H5F_sfile_assert_num(2);
/* Release file 1's EFC */
if(H5Fclear_elink_file_cache(fid1) < 0)
TEST_ERROR
/* Verify that only the parent file is now open */
- if(H5F_sfile_assert_num(1) < 0)
- TEST_ERROR
+ H5F_sfile_assert_num(1);
/* Close file 1 */
if(H5Fclose(fid1) < 0)
TEST_ERROR
/* Verify that both files are now closed */
- if(H5F_sfile_assert_num(0) < 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
/*
@@ -6927,8 +6920,7 @@ external_file_cache(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Verify that only 1 file is open */
- if(H5F_sfile_assert_num(1) < 0)
- TEST_ERROR
+ 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)
@@ -6937,8 +6929,7 @@ external_file_cache(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Verify that files 2 and 3 are now open */
- if(H5F_sfile_assert_num(3) < 0)
- TEST_ERROR
+ 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)
@@ -6947,16 +6938,14 @@ external_file_cache(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Verify that all files are now open */
- if(H5F_sfile_assert_num(4) < 0)
- TEST_ERROR
+ H5F_sfile_assert_num(4);
/* Close file 1 */
if(H5Fclose(fid1) < 0)
TEST_ERROR
/* Verify that all files are now closed */
- if(H5F_sfile_assert_num(0) < 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
/*
@@ -6992,8 +6981,7 @@ external_file_cache(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Verify that only 1 file is open */
- if(H5F_sfile_assert_num(1) < 0)
- TEST_ERROR
+ 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)
@@ -7002,8 +6990,7 @@ external_file_cache(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Verify that files 2 and 3 are now open */
- if(H5F_sfile_assert_num(3) < 0)
- TEST_ERROR
+ 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)
@@ -7012,24 +6999,21 @@ external_file_cache(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Verify that all files are now open */
- if(H5F_sfile_assert_num(4) < 0)
- TEST_ERROR
+ H5F_sfile_assert_num(4);
/* Release file 1's EFC */
if(H5Fclear_elink_file_cache(fid1) < 0)
TEST_ERROR
/* Verify that only file 1 is now open */
- if(H5F_sfile_assert_num(1) < 0)
- TEST_ERROR
+ H5F_sfile_assert_num(1);
/* Close file 1 */
if(H5Fclose(fid1) < 0)
TEST_ERROR
/* Verify that all files are now closed */
- if(H5F_sfile_assert_num(0) < 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
#ifndef H5_CANNOT_OPEN_TWICE
/*
@@ -7061,8 +7045,7 @@ external_file_cache(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Verify that only 1 file is open */
- if(H5F_sfile_assert_num(1) < 0)
- TEST_ERROR
+ 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)
@@ -7071,16 +7054,14 @@ external_file_cache(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Verify that all files are now open */
- if(H5F_sfile_assert_num(3) < 0)
- TEST_ERROR
+ H5F_sfile_assert_num(3);
/* Close file 1 */
if(H5Fclose(fid1) < 0)
TEST_ERROR
/* Verify that all files are now closed */
- if(H5F_sfile_assert_num(0) < 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
/*
@@ -7112,8 +7093,7 @@ external_file_cache(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Verify that only 1 file is open */
- if(H5F_sfile_assert_num(1) < 0)
- TEST_ERROR
+ 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)
@@ -7122,24 +7102,21 @@ external_file_cache(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Verify that all files are now open */
- if(H5F_sfile_assert_num(3) < 0)
- TEST_ERROR
+ H5F_sfile_assert_num(3);
/* Release file 1's EFC */
if(H5Fclear_elink_file_cache(fid1) < 0)
TEST_ERROR
/* Verify that only file 1 is now open */
- if(H5F_sfile_assert_num(1) < 0)
- TEST_ERROR
+ H5F_sfile_assert_num(1);
/* Close file 1 */
if(H5Fclose(fid1) < 0)
TEST_ERROR
/* Verify that all files are now closed */
- if(H5F_sfile_assert_num(0) < 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
#endif /* H5_CANNOT_OPEN_TWICE */
/* Close fapl */
@@ -7234,8 +7211,7 @@ external_open_twice(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Verify that both files are now closed */
- if(H5F_sfile_assert_num(0) < 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
/*
@@ -7281,8 +7257,7 @@ external_open_twice(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Verify that both files are now closed */
- if(H5F_sfile_assert_num(0) < 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
/*
@@ -7332,8 +7307,7 @@ external_open_twice(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Verify that both files are now closed */
- if(H5F_sfile_assert_num(0) < 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
/*
@@ -7381,8 +7355,7 @@ external_open_twice(hid_t fapl, hbool_t new_format)
TEST_ERROR
/* Verify that both files are now closed */
- if(H5F_sfile_assert_num(0) < 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
PASSED();
diff --git a/test/mount.c b/test/mount.c
index b7180fa..2502bbe 100644
--- a/test/mount.c
+++ b/test/mount.c
@@ -1181,7 +1181,7 @@ test_close(hid_t fapl)
/* Check that all file IDs have been closed */
if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR
- if(H5F_sfile_assert_num(0) != 0) TEST_ERROR
+ H5F_sfile_assert_num(0);
/* Build the virtual file again */
if((file1 = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0 ||
@@ -1198,7 +1198,7 @@ test_close(hid_t fapl)
/* Check that all file IDs have been closed */
if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR
- if(H5F_sfile_assert_num(0) != 0) TEST_ERROR
+ H5F_sfile_assert_num(0);
/* Shut down */
PASSED();
@@ -1810,8 +1810,7 @@ test_missing_unmount(hid_t fapl)
/* Check that all file IDs have been closed */
if(H5I_nmembers(H5I_FILE) != 0)
TEST_ERROR
- if(H5F_sfile_assert_num(0) != 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
PASSED();
return 0;
@@ -1946,8 +1945,7 @@ test_hold_open_file(hid_t fapl)
/* Check that all file IDs have been closed */
if(H5I_nmembers(H5I_FILE) != 0)
TEST_ERROR
- if(H5F_sfile_assert_num(0) != 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
PASSED();
return 0;
@@ -2103,8 +2101,7 @@ test_hold_open_group(hid_t fapl)
/* Check that all file IDs have been closed */
if(H5I_nmembers(H5I_FILE) != 0)
TEST_ERROR
- if(H5F_sfile_assert_num(0) != 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
PASSED();
return 0;
@@ -2249,8 +2246,7 @@ test_fcdegree_same(hid_t fapl)
/* Check that all file IDs have been closed */
if(H5I_nmembers(H5I_FILE) != 0)
TEST_ERROR
- if(H5F_sfile_assert_num(0) != 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
PASSED();
return 0;
@@ -2391,8 +2387,7 @@ test_fcdegree_semi(hid_t fapl)
/* Check that all file IDs have been closed */
if(H5I_nmembers(H5I_FILE) != 0)
TEST_ERROR
- if(H5F_sfile_assert_num(0) != 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
PASSED();
return 0;
@@ -2530,8 +2525,7 @@ test_fcdegree_strong(hid_t fapl)
/* Check that all file IDs have been closed */
if(H5I_nmembers(H5I_FILE) != 0)
TEST_ERROR
- if(H5F_sfile_assert_num(0) != 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
PASSED();
return 0;
@@ -2733,8 +2727,7 @@ test_acc_perm(hid_t fapl)
/* Check that all file IDs have been closed */
if(H5I_nmembers(H5I_FILE) != 0)
TEST_ERROR
- if(H5F_sfile_assert_num(0) != 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
PASSED();
return 0;
@@ -2957,8 +2950,7 @@ test_mult_mount(hid_t fapl)
/* Check that all file IDs have been closed */
if(H5I_nmembers(H5I_FILE) != 0)
TEST_ERROR
- if(H5F_sfile_assert_num(0) != 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
PASSED();
return 0;
@@ -3179,8 +3171,7 @@ test_nested_survive(hid_t fapl)
/* Check that all file IDs have been closed */
if(H5I_nmembers(H5I_FILE) != 0)
TEST_ERROR
- if(H5F_sfile_assert_num(0) != 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
PASSED();
return 0;
@@ -3295,8 +3286,7 @@ test_close_parent(hid_t fapl)
TEST_ERROR
/* Both underlying shared files should be open still */
- if(H5F_sfile_assert_num(2) != 0)
- TEST_ERROR
+ H5F_sfile_assert_num(2);
/* Check the name of "M" is still defined */
*name = '\0';
@@ -3317,16 +3307,14 @@ test_close_parent(hid_t fapl)
TEST_ERROR
/* Just file #2's underlying shared file should be open still */
- if(H5F_sfile_assert_num(1) != 0)
- TEST_ERROR
+ H5F_sfile_assert_num(1);
/* Close group in file #2, letting file #2 close */
if(H5Gclose(gidM) < 0)
TEST_ERROR
/* All underlying shared file structs should be closed */
- if(H5F_sfile_assert_num(0) != 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
PASSED();
return 0;
@@ -3703,16 +3691,14 @@ test_cut_graph(hid_t fapl)
TEST_ERROR
/* Check that all seven underlying files are still opened */
- if(H5F_sfile_assert_num(7) != 0)
- TEST_ERROR
+ H5F_sfile_assert_num(7);
/* Close "M" in file #5, which should close files 2, 4 & 5 */
if(H5Gclose(gidM) < 0)
TEST_ERROR
/* Check that only four underlying files are still opened */
- if(H5F_sfile_assert_num(4) != 0)
- TEST_ERROR
+ H5F_sfile_assert_num(4);
/* Unmount file #3 from file #1, cutting the graph */
if(H5Funmount(gidQ, "/B") < 0)
@@ -3720,8 +3706,7 @@ test_cut_graph(hid_t fapl)
/* Check that only three underlying files are still opened */
/* (File #1 should close after being cut off from the graph) */
- if(H5F_sfile_assert_num(3) != 0)
- TEST_ERROR
+ H5F_sfile_assert_num(3);
/* Check the name of "Q" is defined in its file */
*name = '\0';
@@ -3749,8 +3734,7 @@ test_cut_graph(hid_t fapl)
TEST_ERROR
/* Verify that all underlying shared files have been closed now */
- if(H5F_sfile_assert_num(0) != 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
PASSED();
return 0;
@@ -3917,16 +3901,14 @@ test_symlink(hid_t fapl)
TEST_ERROR
/* Verify that all 3 underlying shared files are still open */
- if(H5F_sfile_assert_num(3) != 0)
- TEST_ERROR
+ H5F_sfile_assert_num(3);
/* Close object opened through soft link */
if(H5Gclose(gidL) < 0)
TEST_ERROR
/* Verify that all underlying shared files have been closed now */
- if(H5F_sfile_assert_num(0) != 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
PASSED();
return 0;
@@ -4036,8 +4018,7 @@ test_sharedacc(hid_t fapl)
/* Check that all file IDs have been closed */
if(H5I_nmembers(H5I_FILE) != 0)
TEST_ERROR
- if(H5F_sfile_assert_num(0) != 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
PASSED();
return 0;
@@ -4129,16 +4110,14 @@ test_sharedclose(hid_t fapl)
TEST_ERROR
/* Check that file #3 is still open */
- if(H5F_sfile_assert_num(3) != 0)
- TEST_ERROR
+ H5F_sfile_assert_num(3);
/* Close group B/C in file #1b. This should close file #1b and #3. */
if(H5Gclose(gid3) < 0)
TEST_ERROR
/* Check that file #3 has been closed */
- if(H5F_sfile_assert_num(2) != 0)
- TEST_ERROR
+ H5F_sfile_assert_num(2);
/* Unmount file 2 and close the rest of the handles */
if(H5Funmount(fid1a, "A") < 0)
@@ -4153,8 +4132,7 @@ test_sharedclose(hid_t fapl)
/* Check that all file IDs have been closed */
if(H5I_nmembers(H5I_FILE) != 0)
TEST_ERROR
- if(H5F_sfile_assert_num(0) != 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
/* Create file #1 & its group */
if((fid1a = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -4197,8 +4175,7 @@ test_sharedclose(hid_t fapl)
/* Check that all file IDs have been closed */
if(H5I_nmembers(H5I_FILE) != 0)
TEST_ERROR
- if(H5F_sfile_assert_num(0) != 0)
- TEST_ERROR
+ H5F_sfile_assert_num(0);
PASSED();
return 0;
@@ -4324,7 +4301,7 @@ test_multisharedclose(hid_t fapl)
/* Check that all file IDs have been closed */
if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR
- if(H5F_sfile_assert_num(0) < 0) TEST_ERROR
+ H5F_sfile_assert_num(0);
PASSED();
return 0;
diff --git a/test/testfiles/plist_files/acpl_be b/test/testfiles/plist_files/acpl_be
new file mode 100644
index 0000000..ba342d9
--- /dev/null
+++ b/test/testfiles/plist_files/acpl_be
Binary files differ
diff --git a/test/testfiles/plist_files/acpl_le b/test/testfiles/plist_files/acpl_le
new file mode 100644
index 0000000..ba342d9
--- /dev/null
+++ b/test/testfiles/plist_files/acpl_le
Binary files differ
diff --git a/test/testfiles/plist_files/dapl_be b/test/testfiles/plist_files/dapl_be
new file mode 100644
index 0000000..4df4e7f
--- /dev/null
+++ b/test/testfiles/plist_files/dapl_be
Binary files differ
diff --git a/test/testfiles/plist_files/dapl_le b/test/testfiles/plist_files/dapl_le
new file mode 100644
index 0000000..4df4e7f
--- /dev/null
+++ b/test/testfiles/plist_files/dapl_le
Binary files differ
diff --git a/test/testfiles/plist_files/dcpl_be b/test/testfiles/plist_files/dcpl_be
new file mode 100644
index 0000000..667c67f
--- /dev/null
+++ b/test/testfiles/plist_files/dcpl_be
Binary files differ
diff --git a/test/testfiles/plist_files/dcpl_le b/test/testfiles/plist_files/dcpl_le
new file mode 100644
index 0000000..667c67f
--- /dev/null
+++ b/test/testfiles/plist_files/dcpl_le
Binary files differ
diff --git a/test/testfiles/plist_files/dxpl_be b/test/testfiles/plist_files/dxpl_be
new file mode 100644
index 0000000..5ff2ea0
--- /dev/null
+++ b/test/testfiles/plist_files/dxpl_be
Binary files differ
diff --git a/test/testfiles/plist_files/dxpl_le b/test/testfiles/plist_files/dxpl_le
new file mode 100644
index 0000000..5ff2ea0
--- /dev/null
+++ b/test/testfiles/plist_files/dxpl_le
Binary files differ
diff --git a/test/testfiles/plist_files/fapl_be b/test/testfiles/plist_files/fapl_be
new file mode 100644
index 0000000..8fcefa2
--- /dev/null
+++ b/test/testfiles/plist_files/fapl_be
Binary files differ
diff --git a/test/testfiles/plist_files/fapl_le b/test/testfiles/plist_files/fapl_le
new file mode 100644
index 0000000..8fcefa2
--- /dev/null
+++ b/test/testfiles/plist_files/fapl_le
Binary files differ
diff --git a/test/testfiles/plist_files/fcpl_be b/test/testfiles/plist_files/fcpl_be
new file mode 100644
index 0000000..ffa5242
--- /dev/null
+++ b/test/testfiles/plist_files/fcpl_be
Binary files differ
diff --git a/test/testfiles/plist_files/fcpl_le b/test/testfiles/plist_files/fcpl_le
new file mode 100644
index 0000000..ffa5242
--- /dev/null
+++ b/test/testfiles/plist_files/fcpl_le
Binary files differ
diff --git a/test/testfiles/plist_files/gcpl_be b/test/testfiles/plist_files/gcpl_be
new file mode 100644
index 0000000..1eec32c
--- /dev/null
+++ b/test/testfiles/plist_files/gcpl_be
Binary files differ
diff --git a/test/testfiles/plist_files/gcpl_le b/test/testfiles/plist_files/gcpl_le
new file mode 100644
index 0000000..1eec32c
--- /dev/null
+++ b/test/testfiles/plist_files/gcpl_le
Binary files differ
diff --git a/test/testfiles/plist_files/lapl_be b/test/testfiles/plist_files/lapl_be
new file mode 100644
index 0000000..30f52a4
--- /dev/null
+++ b/test/testfiles/plist_files/lapl_be
Binary files differ
diff --git a/test/testfiles/plist_files/lapl_le b/test/testfiles/plist_files/lapl_le
new file mode 100644
index 0000000..30f52a4
--- /dev/null
+++ b/test/testfiles/plist_files/lapl_le
Binary files differ
diff --git a/test/testfiles/plist_files/lcpl_be b/test/testfiles/plist_files/lcpl_be
new file mode 100644
index 0000000..4584e5c
--- /dev/null
+++ b/test/testfiles/plist_files/lcpl_be
Binary files differ
diff --git a/test/testfiles/plist_files/lcpl_le b/test/testfiles/plist_files/lcpl_le
new file mode 100644
index 0000000..4584e5c
--- /dev/null
+++ b/test/testfiles/plist_files/lcpl_le
Binary files differ
diff --git a/test/testfiles/plist_files/ocpl_be b/test/testfiles/plist_files/ocpl_be
new file mode 100644
index 0000000..bc46636
--- /dev/null
+++ b/test/testfiles/plist_files/ocpl_be
Binary files differ
diff --git a/test/testfiles/plist_files/ocpl_le b/test/testfiles/plist_files/ocpl_le
new file mode 100644
index 0000000..bc46636
--- /dev/null
+++ b/test/testfiles/plist_files/ocpl_le
Binary files differ
diff --git a/test/testfiles/plist_files/ocpypl_be b/test/testfiles/plist_files/ocpypl_be
new file mode 100644
index 0000000..a0d826d
--- /dev/null
+++ b/test/testfiles/plist_files/ocpypl_be
Binary files differ
diff --git a/test/testfiles/plist_files/ocpypl_le b/test/testfiles/plist_files/ocpypl_le
new file mode 100644
index 0000000..a0d826d
--- /dev/null
+++ b/test/testfiles/plist_files/ocpypl_le
Binary files differ
diff --git a/test/testfiles/plist_files/strcpl_be b/test/testfiles/plist_files/strcpl_be
new file mode 100644
index 0000000..4190a63
--- /dev/null
+++ b/test/testfiles/plist_files/strcpl_be
Binary files differ
diff --git a/test/testfiles/plist_files/strcpl_le b/test/testfiles/plist_files/strcpl_le
new file mode 100644
index 0000000..4190a63
--- /dev/null
+++ b/test/testfiles/plist_files/strcpl_le
Binary files differ