summaryrefslogtreecommitdiffstats
path: root/test/tgenprop.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2015-09-16 22:27:49 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2015-09-16 22:27:49 (GMT)
commitee7612be44b3797a903e21433558a52331515ce1 (patch)
treecce28a3a6e169f1668ad1a0356e907f0dddbfde6 /test/tgenprop.c
parent222e7186ea78e49b387284cbb9997677c933c368 (diff)
downloadhdf5-ee7612be44b3797a903e21433558a52331515ce1.zip
hdf5-ee7612be44b3797a903e21433558a52331515ce1.tar.gz
hdf5-ee7612be44b3797a903e21433558a52331515ce1.tar.bz2
[svn-r27811] Description:
Refactor property list code to "deep copy" properties in the correct way, retraining the rest of the library to copy & release things correctly. This cleans up another batch of memory leaks, etc. within the library. Tested on: MacOSX/64 10.10.5 (amazon) w/serial & parallel Linux/32 2.6.x (jam) w/serial & parallel (h5committest forthcoming)
Diffstat (limited to 'test/tgenprop.c')
-rw-r--r--test/tgenprop.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/test/tgenprop.c b/test/tgenprop.c
index f35505f..c4f3a3f 100644
--- a/test/tgenprop.c
+++ b/test/tgenprop.c
@@ -784,7 +784,7 @@ test_genprop_basic_list_prop(void)
ret = H5Pget(lid1, PROP4_NAME,&prop4_value);
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
- if(!H5_FLT_ABS_EQUAL(prop4_value,*PROP4_DEF_VALUE))
+ if(!H5_FLT_ABS_EQUAL(prop4_value,(double)*PROP4_DEF_VALUE))
printf("*** 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__);
@@ -1203,9 +1203,9 @@ test_genprop_list_callback(void)
lid1 = H5Pcreate(cid1);
CHECK_I(lid1, "H5Pcreate");
- /* The compare callback should have been called once on property 1 (to check
- * if the create callback modified the value) */
- VERIFY(prop1_cb_info.cmp_count, 1, "H5Pcreate");
+ /* The compare callback should not have been called once on property 1, as
+ * the property is always copied */
+ VERIFY(prop1_cb_info.cmp_count, 0, "H5Pcreate");
/* The compare callback should not have been called on property 3, as there
* is no create callback */
VERIFY(prop3_cb_info.cmp_count, 0, "H5Pcreate");
@@ -1221,9 +1221,8 @@ test_genprop_list_callback(void)
ret = H5Pget(lid1, PROP1_NAME,&prop1_value);
CHECK_I(ret, "H5Pget");
VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget");
- /* The compare callback should have been called once (to check if the get
- * callback modified the value) */
- VERIFY(prop1_cb_info.cmp_count, 2, "H5Pget");
+ /* The compare callback should not have been called */
+ VERIFY(prop1_cb_info.cmp_count, 0, "H5Pget");
ret = H5Pget(lid1, PROP2_NAME,&prop2_value);
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
@@ -1242,7 +1241,7 @@ test_genprop_list_callback(void)
ret = H5Pget(lid1, PROP4_NAME,&prop4_value);
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
- if(!H5_FLT_ABS_EQUAL(prop4_value,*PROP4_DEF_VALUE))
+ if(!H5_FLT_ABS_EQUAL(prop4_value,(double)*PROP4_DEF_VALUE))
printf("*** 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__);
@@ -1266,17 +1265,15 @@ test_genprop_list_callback(void)
if(HDmemcmp(prop1_cb_info.set_value,&prop1_new_value, PROP1_SIZE)!=0)
TestErrPrintf("Property #1 value doesn't match!, line=%d\n",__LINE__);
- /* The compare callback should have been called once (to check if the new
- * value needed to be copied onto the property list) */
- VERIFY(prop1_cb_info.cmp_count, 3, "H5Pset");
+ /* The compare callback should not have been called */
+ VERIFY(prop1_cb_info.cmp_count, 0, "H5Pset");
/* Set value of property #3 to different value */
ret = H5Pset(lid1, PROP3_NAME,prop3_new_value);
CHECK_I(ret, "H5Pset");
- /* The compare callback should have been called once (to check if the new
- * value needed to be copied onto the property list) */
- VERIFY(prop3_cb_info.cmp_count, 1, "H5Pset");
+ /* The compare callback should not have been called */
+ VERIFY(prop3_cb_info.cmp_count, 0, "H5Pset");
/* Check new value of tracked properties */
ret = H5Pget(lid1, PROP1_NAME,&prop1_value);
@@ -1323,8 +1320,8 @@ test_genprop_list_callback(void)
VERIFY(ret, 1, "H5Pequal");
/* Verify compare callback information for properties tracked */
- VERIFY(prop1_cb_info.cmp_count, 4, "H5Pequal");
- VERIFY(prop3_cb_info.cmp_count, 2, "H5Pequal");
+ VERIFY(prop1_cb_info.cmp_count, 1, "H5Pequal");
+ VERIFY(prop3_cb_info.cmp_count, 1, "H5Pequal");
/* Close first list */
ret = H5Pclose(lid1);