summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2015-09-14 16:21:31 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2015-09-14 16:21:31 (GMT)
commit050dd023870ac6858eaf55c20c7ffd46e97b1454 (patch)
treebd2f4bf92cedc0f45d4aa68d008ff03d05c56e07 /test
parent102337449220dfc29be1cce29147704b9c760832 (diff)
downloadhdf5-050dd023870ac6858eaf55c20c7ffd46e97b1454.zip
hdf5-050dd023870ac6858eaf55c20c7ffd46e97b1454.tar.gz
hdf5-050dd023870ac6858eaf55c20c7ffd46e97b1454.tar.bz2
[svn-r27771] Description:
Merge in part of Neil's property list fixes: Fix a minor memory leak, add some sanity checks, clean up the code a little, and verify that encoding/ decoding default versions of the property lists works correctly. Tested on: MacOSX/64 10.10.5 (amazon) w/serial (Too minor to require h5committest)
Diffstat (limited to 'test')
-rw-r--r--test/enc_dec_plist.c121
1 files changed, 109 insertions, 12 deletions
diff --git a/test/enc_dec_plist.c b/test/enc_dec_plist.c
index 4832767..4f0147e 100644
--- a/test/enc_dec_plist.c
+++ b/test/enc_dec_plist.c
@@ -122,10 +122,18 @@ main(void)
printf("Encode/Decode DCPLs\n");
/******* ENCODE/DECODE DCPLS *****/
- TESTING("DCPL Encoding/Decoding");
+ TESTING("Default DCPL Encoding/Decoding");
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
FAIL_STACK_ERROR
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(dcpl) < 0)
+ FAIL_PUTS_ERROR("Default DCPL encoding/decoding failed\n")
+
+ PASSED();
+
+ TESTING("DCPL Encoding/Decoding");
+
if((H5Pset_chunk(dcpl, 2, chunk_size)) < 0)
FAIL_STACK_ERROR
@@ -161,10 +169,18 @@ main(void)
/******* ENCODE/DECODE DAPLS *****/
- TESTING("DAPL Encoding/Decoding");
+ TESTING("Default DAPL Encoding/Decoding");
if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
FAIL_STACK_ERROR
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(dapl) < 0)
+ FAIL_PUTS_ERROR("Default DAPL encoding/decoding failed\n")
+
+ PASSED();
+
+ TESTING("DAPL Encoding/Decoding");
+
if((H5Pset_chunk_cache(dapl, nslots, nbytes, w0)) < 0)
FAIL_STACK_ERROR
@@ -180,10 +196,18 @@ main(void)
/******* ENCODE/DECODE OCPLS *****/
- TESTING("OCPL Encoding/Decoding");
+ TESTING("Default OCPL Encoding/Decoding");
if((ocpl = H5Pcreate(H5P_OBJECT_CREATE)) < 0)
FAIL_STACK_ERROR
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(ocpl) < 0)
+ FAIL_PUTS_ERROR("Default OCPL encoding/decoding failed\n")
+
+ PASSED();
+
+ TESTING("OCPL Encoding/Decoding");
+
if((H5Pset_attr_creation_order(ocpl, (H5P_CRT_ORDER_TRACKED | H5P_CRT_ORDER_INDEXED))) < 0)
FAIL_STACK_ERROR
@@ -205,9 +229,18 @@ main(void)
/******* ENCODE/DECODE DXPLS *****/
- TESTING("DXPL Encoding/Decoding");
+ TESTING("Default DXPL Encoding/Decoding");
if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0)
FAIL_STACK_ERROR
+
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(dxpl) < 0)
+ FAIL_PUTS_ERROR("Default DXPL encoding/decoding failed\n")
+
+ PASSED();
+
+ TESTING("DXPL Encoding/Decoding");
+
if((H5Pset_btree_ratios(dxpl, 0.2f, 0.6f, 0.2f)) < 0)
FAIL_STACK_ERROR
if((H5Pset_hyper_vector_size(dxpl, 5)) < 0)
@@ -241,10 +274,18 @@ main(void)
/******* ENCODE/DECODE GCPLS *****/
- TESTING("GCPL Encoding/Decoding");
+ TESTING("Default GCPL Encoding/Decoding");
if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0)
FAIL_STACK_ERROR
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(gcpl) < 0)
+ FAIL_PUTS_ERROR("Default GCPL encoding/decoding failed\n")
+
+ PASSED();
+
+ TESTING("GCPL Encoding/Decoding");
+
if((H5Pset_local_heap_size_hint(gcpl, 256)) < 0)
FAIL_STACK_ERROR
@@ -273,10 +314,18 @@ main(void)
/******* ENCODE/DECODE LCPLS *****/
- TESTING("LCPL Encoding/Decoding");
+ TESTING("Default LCPL Encoding/Decoding");
if((lcpl = H5Pcreate(H5P_LINK_CREATE)) < 0)
FAIL_STACK_ERROR
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(lcpl) < 0)
+ FAIL_PUTS_ERROR("Default LCPL encoding/decoding failed\n")
+
+ PASSED();
+
+ TESTING("LCPL Encoding/Decoding");
+
if((H5Pset_create_intermediate_group(lcpl, TRUE)) < 0)
FAIL_STACK_ERROR
@@ -292,10 +341,18 @@ main(void)
/******* ENCODE/DECODE LAPLS *****/
- TESTING("LAPL Encoding/Decoding");
+ TESTING("Default LAPL Encoding/Decoding");
if((lapl = H5Pcreate(H5P_LINK_ACCESS)) < 0)
FAIL_STACK_ERROR
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(lapl) < 0)
+ FAIL_PUTS_ERROR("Default LAPL encoding/decoding failed\n")
+
+ PASSED();
+
+ TESTING("LAPL Encoding/Decoding");
+
if((H5Pset_nlinks(lapl, (size_t)134)) < 0)
FAIL_STACK_ERROR
@@ -330,10 +387,18 @@ main(void)
/******* ENCODE/DECODE OCPYPLS *****/
- TESTING("OCPYPL Encoding/Decoding");
+ TESTING("Default OCPYPL Encoding/Decoding");
if((ocpypl = H5Pcreate(H5P_OBJECT_COPY)) < 0)
FAIL_STACK_ERROR
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(ocpypl) < 0)
+ FAIL_PUTS_ERROR("Default OCPYPL encoding/decoding failed\n")
+
+ PASSED();
+
+ TESTING("OCPYPL Encoding/Decoding");
+
if((H5Pset_copy_object(ocpypl, H5O_COPY_EXPAND_EXT_LINK_FLAG)) < 0)
FAIL_STACK_ERROR
@@ -354,10 +419,18 @@ main(void)
/******* ENCODE/DECODE FAPLS *****/
- TESTING("FAPL Encoding/Decoding");
+ TESTING("Default FAPL Encoding/Decoding");
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
FAIL_STACK_ERROR
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(fapl) < 0)
+ FAIL_PUTS_ERROR("Default FAPL encoding/decoding failed\n")
+
+ PASSED();
+
+ TESTING("FAPL Encoding/Decoding");
+
if((H5Pset_family_offset(fapl, 1024)) < 0)
FAIL_STACK_ERROR
if((H5Pset_meta_block_size(fapl, 2098452)) < 0)
@@ -397,11 +470,19 @@ main(void)
/******* ENCODE/DECODE FCPLS *****/
- TESTING("FCPL Encoding/Decoding");
+ TESTING("Default FCPL Encoding/Decoding");
if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
FAIL_STACK_ERROR
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(fcpl) < 0)
+ FAIL_PUTS_ERROR("Default FCPL encoding/decoding failed\n")
+
+ PASSED();
+
+ TESTING("FCPL Encoding/Decoding");
+
if((H5Pset_userblock(fcpl, 1024) < 0))
FAIL_STACK_ERROR
@@ -435,11 +516,19 @@ main(void)
/******* ENCODE/DECODE STRCPLS *****/
- TESTING("STRCPL Encoding/Decoding");
+ TESTING("Default STRCPL Encoding/Decoding");
if((strcpl = H5Pcreate(H5P_STRING_CREATE)) < 0)
FAIL_STACK_ERROR
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(strcpl) < 0)
+ FAIL_PUTS_ERROR("Default STRCPL encoding/decoding failed\n")
+
+ PASSED();
+
+ TESTING("STRCPL Encoding/Decoding");
+
if((H5Pset_char_encoding(strcpl, H5T_CSET_UTF8) < 0))
FAIL_STACK_ERROR
@@ -455,11 +544,19 @@ main(void)
/******* ENCODE/DECODE ACPLS *****/
- TESTING("ACPL Encoding/Decoding");
+ TESTING("Default ACPL Encoding/Decoding");
if((acpl = H5Pcreate(H5P_ATTRIBUTE_CREATE)) < 0)
FAIL_STACK_ERROR
+ /* Test encoding & decoding default property list */
+ if(test_encode_decode(acpl) < 0)
+ FAIL_PUTS_ERROR("Default ACPL encoding/decoding failed\n")
+
+ PASSED();
+
+ TESTING("ACPL Encoding/Decoding");
+
if((H5Pset_char_encoding(acpl, H5T_CSET_UTF8) < 0))
FAIL_STACK_ERROR