summaryrefslogtreecommitdiffstats
path: root/test/tgenprop.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-02-27 20:51:49 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-02-27 20:51:49 (GMT)
commitc3e5a191940ab521fad2c917e852622cbebd67c8 (patch)
tree3cafb70c78389ee106a78eb60fd28b7bef98c1ad /test/tgenprop.c
parentc56a7d4ee29dc2ae89e76c8915bc142bd62485b1 (diff)
downloadhdf5-c3e5a191940ab521fad2c917e852622cbebd67c8.zip
hdf5-c3e5a191940ab521fad2c917e852622cbebd67c8.tar.gz
hdf5-c3e5a191940ab521fad2c917e852622cbebd67c8.tar.bz2
[svn-r18348] Description:
Bring r18346 from trunk to 1.8 branch: Bring Coverity fixes back from branch to trunk: r18336: Fix coverity issues 275, 276, 277, 323, 432, 433, and 434 r18337: Fix Coverity issue #106: release free space section node on error r18338: Fixed Coverity #94 - In H5P_register, new_class wasn't closed when there's an error after it's created. r18339: Fix Coverity #185 - In test_conv_str_1, BUF wasn't freed when there's an error in this function. r18340: Correct error in r18337 that wasn't releasing indirect fractal heap block early enough. r18341: Close nodes if any failed in the middle of allocating new nodes. Coverity 140 and 141 r18342: Correct [another] problem w/r18337. r18343: Fix coverity items 185, 20, and 21. r18344: Fix Coverity 213 - In H5FD_family_close, the double pointer file->memb was dereferenced without NULL checking (We believe). r18345: Fix Coverity issue # 210; removed NULL check after pointer dereferenced in H5HFdblock.c. Also assigned NULL to pointer in H5Pint.c to fix segmentation fault. Tested on: FreeBSD/32 6.3 (duty) w/debug) (h5committested on trunk)
Diffstat (limited to 'test/tgenprop.c')
-rw-r--r--test/tgenprop.c48
1 files changed, 42 insertions, 6 deletions
diff --git a/test/tgenprop.c b/test/tgenprop.c
index 8fb2e23..5f9a69b 100644
--- a/test/tgenprop.c
+++ b/test/tgenprop.c
@@ -289,10 +289,10 @@ test_genprop_iter1(hid_t id, const char *name, void *iter_data)
struct { /* Struct for iterations */
int iter_count;
const char **names;
- } *iter_struct=iter_data;
+ } *iter_struct = iter_data;
/* Shut compiler up */
- id=id;
+ id = id;
return(HDstrcmp(name,iter_struct->names[iter_struct->iter_count++]));
}
@@ -1473,18 +1473,26 @@ test_genprop_class_addprop(void)
sid = H5Screate(H5S_SCALAR);
CHECK(sid, FAIL, "H5Screate");
- /* Create a new class, dervied from the dataset creation property list class */
- cid = H5Pcreate_class(H5P_DATASET_CREATE,CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL);
+ /* Create a new class, derived from the dataset creation property list class */
+ cid = H5Pcreate_class(H5P_DATASET_CREATE, CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(cid, "H5Pcreate_class");
/* Check existence of an original property */
- ret = H5Pexist(cid,H5O_CRT_PIPELINE_NAME);
- VERIFY(ret, 0, "H5Pexist");
+ ret = H5Pexist(cid, H5O_CRT_PIPELINE_NAME);
+ VERIFY(ret, 1, "H5Pexist");
/* Insert first property into class (with no callbacks) */
ret = H5Pregister2(cid, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
+ /* Check existence of an original property */
+ ret = H5Pexist(cid, H5O_CRT_PIPELINE_NAME);
+ VERIFY(ret, 1, "H5Pexist");
+
+ /* Check existence of added property */
+ ret = H5Pexist(cid, PROP1_NAME);
+ VERIFY(ret, 1, "H5Pexist");
+
/* Create a derived dataset creation property list */
pid = H5Pcreate(cid);
CHECK(pid, FAIL, "H5Pcreate");
@@ -1502,6 +1510,34 @@ test_genprop_class_addprop(void)
CHECK_I(ret, "H5Pget");
VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget");
+ /* Insert second property into class (with no callbacks) */
+ ret = H5Pregister2(cid, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ CHECK_I(ret, "H5Pregister2");
+
+ /* Check existence of an original property (in class) */
+ ret = H5Pexist(cid, H5O_CRT_PIPELINE_NAME);
+ VERIFY(ret, 1, "H5Pexist");
+
+ /* Check existence of first added property (in class) */
+ ret = H5Pexist(cid, PROP1_NAME);
+ VERIFY(ret, 1, "H5Pexist");
+
+ /* Check existence of second added property (in class) */
+ ret = H5Pexist(cid, PROP2_NAME);
+ VERIFY(ret, 1, "H5Pexist");
+
+ /* Check existence of an original property (in property list) */
+ ret = H5Pexist(pid, H5O_CRT_PIPELINE_NAME);
+ VERIFY(ret, 1, "H5Pexist");
+
+ /* Check existence of first added property (in property list) */
+ ret = H5Pexist(pid, PROP1_NAME);
+ VERIFY(ret, 1, "H5Pexist");
+
+ /* Check existence of second added property (in property list) (should not exist) */
+ ret = H5Pexist(pid, PROP2_NAME);
+ VERIFY(ret, 0, "H5Pexist");
+
/* Create a dataset */
did = H5Dcreate2(fid, "Dataset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, pid, H5P_DEFAULT);
CHECK(did, FAIL, "H5Dcreate2");