summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2001-08-10 20:47:05 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2001-08-10 20:47:05 (GMT)
commit95862451f78960cab031031011e5c6a131e0d026 (patch)
tree391101ca102fbecbfe9cee1f608b90bb87d49b1a /test
parent4049965d1337bc54a21a4d3af71aa793e4baf029 (diff)
downloadhdf5-95862451f78960cab031031011e5c6a131e0d026.zip
hdf5-95862451f78960cab031031011e5c6a131e0d026.tar.gz
hdf5-95862451f78960cab031031011e5c6a131e0d026.tar.bz2
[svn-r4324] Purpose:
New Features! Description: Start migrating the internal use of property lists in the library from the older implementation to the new generic property lists. Currently, only the dataset transfer property lists are migrated to the new architecture, all the rest of the property list types are still using the older architecture. Also, the backward compatibility features are not implemented yet, so applications which use dataset transfer properties may need to make the following changes: H5Pcreate(H5P_DATASET_XFER) -> H5Pcreate_list(H5P_DATASET_XFER_NEW) and H5Pclose(<a dataset transfer property list>) -> H5Pclose_list(id) This still may have some bugs in it, especially with Fortran, but I should be wrapping up those later today. Platforms tested: FreeBSD 4.4 (hawkwind)
Diffstat (limited to 'test')
-rw-r--r--test/cmpd_dset.c4
-rw-r--r--test/dsets.c8
-rw-r--r--test/istore.c8
-rw-r--r--test/tarray.c12
-rw-r--r--test/tgenprop.c157
-rw-r--r--test/tselect.c10
-rw-r--r--test/tvlstr.c4
-rw-r--r--test/tvltypes.c16
8 files changed, 141 insertions, 78 deletions
diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c
index 0fbb346..ee00e50 100644
--- a/test/cmpd_dset.c
+++ b/test/cmpd_dset.c
@@ -157,7 +157,7 @@ main (int argc, char *argv[])
if ((space = H5Screate_simple (2, dim, NULL))<0) goto error;
/* Create xfer properties to preserve initialized data */
- if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) goto error;
+ if ((PRESERVE = H5Pcreate_list (H5P_DATASET_XFER_NEW))<0) goto error;
if (H5Pset_preserve (PRESERVE, 1)<0) goto error;
/*
@@ -703,7 +703,7 @@ main (int argc, char *argv[])
/*
* Release resources.
*/
- H5Pclose (PRESERVE);
+ H5Pclose_list (PRESERVE);
H5Dclose (dataset);
H5Fclose (file);
diff --git a/test/dsets.c b/test/dsets.c
index 798d9fe..c55e25f 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -198,7 +198,7 @@ test_simple_io(hid_t file)
/* Create a small conversion buffer to test strip mining */
tconv_buf = malloc (1000);
- xfer = H5Pcreate (H5P_DATASET_XFER);
+ xfer = H5Pcreate_list (H5P_DATASET_XFER_NEW);
assert (xfer>=0);
if (H5Pset_buffer (xfer, 1000, tconv_buf, NULL)<0) goto error;
@@ -226,7 +226,7 @@ test_simple_io(hid_t file)
}
}
- H5Pclose (xfer);
+ i=H5Pclose_list (xfer);
H5Dclose(dataset);
free (tconv_buf);
PASSED();
@@ -383,7 +383,7 @@ test_compression(hid_t file)
* Create a small conversion buffer to test strip mining. We
* might as well test all we can!
*/
- if ((xfer = H5Pcreate (H5P_DATASET_XFER))<0) goto error;
+ if ((xfer = H5Pcreate_list (H5P_DATASET_XFER_NEW))<0) goto error;
tconv_buf = malloc (1000);
if (H5Pset_buffer (xfer, 1000, tconv_buf, NULL)<0) goto error;
@@ -637,7 +637,7 @@ test_compression(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Pclose (xfer)<0) goto error;
+ if (H5Pclose_list (xfer)<0) goto error;
if (H5Pclose (dc)<0) goto error;
if (H5Dclose(dataset)<0) goto error;
free (tconv_buf);
diff --git a/test/istore.c b/test/istore.c
index 78142f7..4fddbe3 100644
--- a/test/istore.c
+++ b/test/istore.c
@@ -299,7 +299,7 @@ test_extend(H5F_t *f, const char *prefix,
memset(buf, (signed)(128+ctr), (size_t)nelmts);
/* Write to disk */
- if (H5F_arr_write(f, H5P_DEFAULT, &layout, NULL, NULL, NULL, size,
+ if (H5F_arr_write(f, H5P_DATASET_XFER_DEFAULT, &layout, NULL, NULL, NULL, size,
size, zero, offset, buf)<0) {
H5_FAILED();
printf(" Write failed: ctr=%lu\n", (unsigned long)ctr);
@@ -308,7 +308,7 @@ test_extend(H5F_t *f, const char *prefix,
/* Read from disk */
memset(check, 0xff, (size_t)nelmts);
- if (H5F_arr_read(f, H5P_DEFAULT, &layout, NULL, NULL, NULL, size,
+ if (H5F_arr_read(f, H5P_DATASET_XFER_DEFAULT, &layout, NULL, NULL, NULL, size,
size, zero, offset, check)<0) {
H5_FAILED();
printf(" Read failed: ctr=%lu\n", (unsigned long)ctr);
@@ -339,7 +339,7 @@ test_extend(H5F_t *f, const char *prefix,
/* Now read the entire array back out and check it */
memset(buf, 0xff, nx * ny * nz);
- if (H5F_arr_read(f, H5P_DEFAULT, &layout, NULL, NULL, NULL, whole_size,
+ if (H5F_arr_read(f, H5P_DATASET_XFER_DEFAULT, &layout, NULL, NULL, NULL, whole_size,
whole_size, zero, zero, buf)<0) {
H5_FAILED();
puts(" Read failed for whole array.");
@@ -452,7 +452,7 @@ test_sparse(H5F_t *f, const char *prefix, size_t nblocks,
memset(buf, (signed)(128+ctr), nx * ny * nz);
/* write to disk */
- if (H5F_arr_write(f, H5P_DEFAULT, &layout, NULL, NULL, NULL, size,
+ if (H5F_arr_write(f, H5P_DATASET_XFER_DEFAULT, &layout, NULL, NULL, NULL, size,
size, zero, offset, buf)<0) {
H5_FAILED();
printf(" Write failed: ctr=%lu\n", (unsigned long)ctr);
diff --git a/test/tarray.c b/test/tarray.c
index 9e5853b..306b706 100644
--- a/test/tarray.c
+++ b/test/tarray.c
@@ -1141,7 +1141,7 @@ test_array_vlen_atomic(void)
CHECK(ret, FAIL, "H5Tclose");
/* Change to the custom memory allocation routines for reading VL data */
- xfer_pid=H5Pcreate(H5P_DATASET_XFER);
+ xfer_pid=H5Pcreate_list(H5P_DATASET_XFER_NEW);
CHECK(xfer_pid, FAIL, "H5Pcreate");
ret=H5Pset_vlen_mem_manager(xfer_pid,test_array_alloc_custom,&mem_used,test_array_free_custom,&mem_used);
@@ -1195,6 +1195,10 @@ test_array_vlen_atomic(void)
ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,wdata);
CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ /* Close dataset transfer property list */
+ ret = H5Pclose_list(xfer_pid);
+ CHECK(ret, FAIL, "H5Pclose");
+
/* Close Datatype */
ret = H5Tclose(tid1);
CHECK(ret, FAIL, "H5Tclose");
@@ -1391,7 +1395,7 @@ test_array_vlen_array(void)
CHECK(ret, FAIL, "H5Tclose");
/* Change to the custom memory allocation routines for reading VL data */
- xfer_pid=H5Pcreate(H5P_DATASET_XFER);
+ xfer_pid=H5Pcreate_list(H5P_DATASET_XFER_NEW);
CHECK(xfer_pid, FAIL, "H5Pcreate");
ret=H5Pset_vlen_mem_manager(xfer_pid,test_array_alloc_custom,&mem_used,test_array_free_custom,&mem_used);
@@ -1447,6 +1451,10 @@ test_array_vlen_array(void)
ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,wdata);
CHECK(ret, FAIL, "H5Dvlen_reclaim");
+ /* Close dataset transfer property list */
+ ret = H5Pclose_list(xfer_pid);
+ CHECK(ret, FAIL, "H5Pclose");
+
/* Close Datatype */
ret = H5Tclose(tid1);
CHECK(ret, FAIL, "H5Tclose");
diff --git a/test/tgenprop.c b/test/tgenprop.c
index 7a4fdf5..1a0b75f 100644
--- a/test/tgenprop.c
+++ b/test/tgenprop.c
@@ -72,7 +72,7 @@ test_genprop_basic_class(void)
MESSAGE(5, ("Testing Basic Generic Property List Class Creation Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
- cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL);
+ cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Check class name */
@@ -105,7 +105,7 @@ test_genprop_basic_class(void)
CHECK_I(ret, "H5Pclose_class");
/* Create another new generic class, derived from file creation class */
- cid1 = H5Pcreate_class(H5P_FILE_CREATE_NEW,CLASS2_NAME,CLASS2_HASHSIZE,NULL,NULL,NULL,NULL);
+ cid1 = H5Pcreate_class(H5P_FILE_CREATE_NEW,CLASS2_NAME,CLASS2_HASHSIZE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Check class name */
@@ -164,7 +164,7 @@ test_genprop_basic_class_prop(void)
MESSAGE(5, ("Testing Basic Generic Property List Class Properties Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
- cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL);
+ cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Check the number of properties in class */
@@ -177,11 +177,11 @@ test_genprop_basic_class_prop(void)
VERIFY(ret, 0, "H5Pexist");
/* Insert first property into class (with no callbacks) */
- ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Try to insert the first property again (should fail) */
- ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
VERIFY(ret, FAIL, "H5Pregister");
/* Check the existance of the first property */
@@ -199,11 +199,11 @@ test_genprop_basic_class_prop(void)
VERIFY(nprops, 1, "H5Pget_nprops");
/* Insert second property into class (with no callbacks) */
- ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Try to insert the second property again (should fail) */
- ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
VERIFY(ret, FAIL, "H5Pregister");
/* Check the existance of the second property */
@@ -221,7 +221,7 @@ test_genprop_basic_class_prop(void)
VERIFY(nprops, 2, "H5Pget_nprops");
/* Insert third property into class (with no callbacks) */
- ret = H5Pregister(cid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pregister(cid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Check the existance of the third property */
@@ -320,23 +320,23 @@ test_genprop_class_iter(void)
MESSAGE(5, ("Testing Basic Generic Property List Class Property Iteration Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
- cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL);
+ cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Insert first property into class (with no callbacks) */
- ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Insert second property into class (with no callbacks) */
- ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Insert third property into class (with no callbacks) */
- ret = H5Pregister(cid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pregister(cid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Insert third property into class (with no callbacks) */
- ret = H5Pregister(cid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pregister(cid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Check the number of properties in class */
@@ -403,23 +403,23 @@ test_genprop_class_callback(void)
MESSAGE(5, ("Testing Basic Generic Property List Class Callback Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
- cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,test_genprop_cls_cb1,&crt_cb_struct,test_genprop_cls_cb1,&cls_cb_struct);
+ cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,test_genprop_cls_cb1,&crt_cb_struct,NULL,NULL,test_genprop_cls_cb1,&cls_cb_struct);
CHECK_I(cid1, "H5Pcreate_class");
/* Insert first property into class (with no callbacks) */
- ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Insert second property into class (with no callbacks) */
- ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Insert third property into class (with no callbacks) */
- ret = H5Pregister(cid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pregister(cid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Insert fourth property into class (with no callbacks) */
- ret = H5Pregister(cid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pregister(cid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Check the number of properties in class */
@@ -502,17 +502,17 @@ test_genprop_basic_list(void)
MESSAGE(5, ("Testing Basic Generic Property List Creation Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
- cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL);
+ cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Add several properties (w/default values) */
/* Insert first property into class (with no callbacks) */
- ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Insert second property into class (with no callbacks) */
- ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Check the number of properties in class */
@@ -604,17 +604,17 @@ test_genprop_basic_list_prop(void)
MESSAGE(5, ("Testing Basic Generic Property List Property Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
- cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL);
+ cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Add several properties (several w/default values) */
/* Insert first property into class (with no callbacks) */
- ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Insert second property into class (with no callbacks) */
- ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Create a property list from the class */
@@ -629,11 +629,11 @@ test_genprop_basic_list_prop(void)
/* Add temporary properties */
/* Insert first temporary property into class (with no callbacks) */
- ret = H5Pinsert(lid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL);
+ ret = H5Pinsert(lid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pinsert");
/* Insert second temporary property into class (with no callbacks) */
- ret = H5Pinsert(lid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL);
+ ret = H5Pinsert(lid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pinsert");
/* Check the number of properties in list */
@@ -761,17 +761,17 @@ test_genprop_list_iter(void)
MESSAGE(5, ("Testing Generic Property List Iteration Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
- cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL);
+ cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Add several properties (several w/default values) */
/* Insert first property into class (with no callbacks) */
- ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Insert second property into class (with no callbacks) */
- ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Create a property list from the class */
@@ -786,11 +786,11 @@ test_genprop_list_iter(void)
/* Add temporary properties */
/* Insert first temporary property into class (with no callbacks) */
- ret = H5Pinsert(lid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL);
+ ret = H5Pinsert(lid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pinsert");
/* Insert second temporary property into class (with no callbacks) */
- ret = H5Pinsert(lid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL);
+ ret = H5Pinsert(lid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pinsert");
/* Check the number of properties in list */
@@ -844,6 +844,11 @@ typedef struct {
char *del_name;
void *del_value;
+ /* Copy information */
+ int cop_count;
+ char *cop_name;
+ void *cop_value;
+
/* Close information */
int cls_count;
char *cls_name;
@@ -860,13 +865,13 @@ prop_cb_info prop2_cb_info; /* Callback statistics for property #2 */
**
****************************************************************/
static herr_t
-test_genprop_prop_crt_cb1(const char *name, void *def_value)
+test_genprop_prop_crt_cb1(const char *name, size_t size, void *def_value)
{
/* Set the information from the creation call */
prop1_cb_info.crt_count++;
prop1_cb_info.crt_name=HDstrdup(name);
- prop1_cb_info.crt_value=HDmalloc(PROP1_SIZE);
- HDmemcpy(prop1_cb_info.crt_value,def_value,PROP1_SIZE);
+ prop1_cb_info.crt_value=HDmalloc(size);
+ HDmemcpy(prop1_cb_info.crt_value,def_value,size);
return(SUCCEED);
}
@@ -877,7 +882,7 @@ test_genprop_prop_crt_cb1(const char *name, void *def_value)
**
****************************************************************/
static herr_t
-test_genprop_prop_set_cb1(hid_t plist_id, const char *name, void *value)
+test_genprop_prop_set_cb1(hid_t plist_id, const char *name, size_t size, void *value)
{
/* Set the information from the set call */
prop1_cb_info.set_count++;
@@ -885,8 +890,8 @@ test_genprop_prop_set_cb1(hid_t plist_id, const char *name, void *value)
if(prop1_cb_info.set_name==NULL)
prop1_cb_info.set_name=HDstrdup(name);
if(prop1_cb_info.set_value==NULL)
- prop1_cb_info.set_value=HDmalloc(PROP1_SIZE);
- HDmemcpy(prop1_cb_info.set_value,value,PROP1_SIZE);
+ prop1_cb_info.set_value=HDmalloc(size);
+ HDmemcpy(prop1_cb_info.set_value,value,size);
return(SUCCEED);
}
@@ -897,7 +902,7 @@ test_genprop_prop_set_cb1(hid_t plist_id, const char *name, void *value)
**
****************************************************************/
static herr_t
-test_genprop_prop_get_cb1(hid_t plist_id, const char *name, void *value)
+test_genprop_prop_get_cb1(hid_t plist_id, const char *name, size_t size, void *value)
{
/* Set the information from the get call */
prop1_cb_info.get_count++;
@@ -905,8 +910,27 @@ test_genprop_prop_get_cb1(hid_t plist_id, const char *name, void *value)
if(prop1_cb_info.get_name==NULL)
prop1_cb_info.get_name=HDstrdup(name);
if(prop1_cb_info.get_value==NULL)
- prop1_cb_info.get_value=HDmalloc(PROP1_SIZE);
- HDmemcpy(prop1_cb_info.get_value,value,PROP1_SIZE);
+ prop1_cb_info.get_value=HDmalloc(size);
+ HDmemcpy(prop1_cb_info.get_value,value,size);
+
+ return(SUCCEED);
+}
+
+/****************************************************************
+**
+** test_genprop_prop_cop_cb1(): Property copy callback for test_genprop_list_callback
+**
+****************************************************************/
+static herr_t
+test_genprop_prop_cop_cb1(const char *name, size_t size, void *value)
+{
+ /* Set the information from the get call */
+ prop1_cb_info.cop_count++;
+ if(prop1_cb_info.cop_name==NULL)
+ prop1_cb_info.cop_name=HDstrdup(name);
+ if(prop1_cb_info.cop_value==NULL)
+ prop1_cb_info.cop_value=HDmalloc(size);
+ HDmemcpy(prop1_cb_info.cop_value,value,size);
return(SUCCEED);
}
@@ -917,13 +941,13 @@ test_genprop_prop_get_cb1(hid_t plist_id, const char *name, void *value)
**
****************************************************************/
static herr_t
-test_genprop_prop_cls_cb1(const char *name, void *value)
+test_genprop_prop_cls_cb1(const char *name, size_t size, void *value)
{
/* Set the information from the close call */
prop1_cb_info.cls_count++;
prop1_cb_info.cls_name=HDstrdup(name);
- prop1_cb_info.cls_value=HDmalloc(PROP1_SIZE);
- HDmemcpy(prop1_cb_info.cls_value,value,PROP1_SIZE);
+ prop1_cb_info.cls_value=HDmalloc(size);
+ HDmemcpy(prop1_cb_info.cls_value,value,size);
return(SUCCEED);
}
@@ -934,14 +958,14 @@ test_genprop_prop_cls_cb1(const char *name, void *value)
**
****************************************************************/
static herr_t
-test_genprop_prop_del_cb2(hid_t plist_id, const char *name, void *value)
+test_genprop_prop_del_cb2(hid_t plist_id, const char *name, size_t size, void *value)
{
/* Set the information from the delete call */
prop2_cb_info.del_count++;
prop2_cb_info.del_plist_id=plist_id;
prop2_cb_info.del_name=HDstrdup(name);
- prop2_cb_info.del_value=HDmalloc(PROP2_SIZE);
- HDmemcpy(prop2_cb_info.del_value,value,PROP2_SIZE);
+ prop2_cb_info.del_value=HDmalloc(size);
+ HDmemcpy(prop2_cb_info.del_value,value,size);
return(SUCCEED);
}
@@ -957,35 +981,40 @@ test_genprop_list_callback(void)
{
hid_t cid1; /* Generic Property class ID */
hid_t lid1; /* Generic Property list ID */
+ hid_t lid2; /* 2nd Generic Property list ID */
size_t nprops; /* Number of properties in class */
int prop1_value; /* Value for property #1 */
int prop1_new_value=20; /* Property #1 new value */
float prop2_value; /* Value for property #2 */
char prop3_value[10];/* Property #3 value */
double prop4_value; /* Property #4 value */
+ struct { /* Struct for callbacks */
+ int count;
+ hid_t id;
+ } cop_cb_struct;
herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Property Callback Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
- cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL);
+ cid1 = H5Pcreate_class(H5P_NO_CLASS_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,test_genprop_cls_cb1,&cop_cb_struct,NULL,NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Insert first property into class (with callbacks) */
- ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,test_genprop_prop_crt_cb1,test_genprop_prop_set_cb1,test_genprop_prop_get_cb1,NULL,test_genprop_prop_cls_cb1);
+ ret = H5Pregister(cid1,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,test_genprop_prop_crt_cb1,test_genprop_prop_set_cb1,test_genprop_prop_get_cb1,NULL,test_genprop_prop_cop_cb1,test_genprop_prop_cls_cb1);
CHECK_I(ret, "H5Pregister");
/* Insert second property into class (with only delete callback) */
- ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,test_genprop_prop_del_cb2,NULL);
+ ret = H5Pregister(cid1,PROP2_NAME,PROP2_SIZE,PROP2_DEF_VALUE,NULL,NULL,NULL,test_genprop_prop_del_cb2,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Insert third property into class (with no callbacks) */
- ret = H5Pregister(cid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pregister(cid1,PROP3_NAME,PROP3_SIZE,PROP3_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Insert fourth property into class (with no callbacks) */
- ret = H5Pregister(cid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pregister(cid1,PROP4_NAME,PROP4_SIZE,PROP4_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(ret, "H5Pregister");
/* Check the number of properties in class */
@@ -993,8 +1022,13 @@ test_genprop_list_callback(void)
CHECK_I(ret, "H5Pget_nprops");
VERIFY(nprops, 4, "H5Pget_nprops");
+ /* Initialize class callback structs */
+ cop_cb_struct.count=0;
+ cop_cb_struct.id=(-1);
+
/* Initialize callback information for properties tracked */
HDmemset(&prop1_cb_info,0,sizeof(prop_cb_info));
+ HDmemset(&prop2_cb_info,0,sizeof(prop_cb_info));
/* Create a property list from the class */
lid1 = H5Pcreate_list(cid1);
@@ -1091,6 +1125,25 @@ test_genprop_list_callback(void)
printf("Property #2 value doesn't match!, line=%d\n",__LINE__);
} /* end if */
+ /* Copy first list */
+ lid2 = H5Pcopy(lid1);
+ CHECK_I(lid2, "H5Pcopy");
+
+ /* Verify copy callback information for properties tracked */
+ VERIFY(prop1_cb_info.cop_count, 1, "H5Pcopy");
+ if(HDstrcmp(prop1_cb_info.cop_name,PROP1_NAME)!=0) {
+ num_errs++;
+ printf("Property #1 name doesn't match!, line=%d\n",__LINE__);
+ } /* end if */
+ if(HDmemcmp(prop1_cb_info.cop_value,&prop1_new_value,PROP1_SIZE)!=0) {
+ num_errs++;
+ printf("Property #1 value doesn't match!, line=%d\n",__LINE__);
+ } /* end if */
+
+ /* Verify that the class creation callback occurred */
+ VERIFY(cop_cb_struct.count, 1, "H5Pcopy");
+ VERIFY(cop_cb_struct.id, lid2, "H5Pcopy");
+
/* Close first list */
ret = H5Pclose_list(lid1);
CHECK_I(ret, "H5Pclose_list");
@@ -1113,6 +1166,8 @@ test_genprop_list_callback(void)
HDfree(prop1_cb_info.get_value);
HDfree(prop1_cb_info.set_name);
HDfree(prop1_cb_info.set_value);
+ HDfree(prop1_cb_info.cop_name);
+ HDfree(prop1_cb_info.cop_value);
HDfree(prop1_cb_info.cls_name);
HDfree(prop1_cb_info.cls_value);
HDfree(prop2_cb_info.del_name);
diff --git a/test/tselect.c b/test/tselect.c
index 3dcd1d3..69472d8 100644
--- a/test/tselect.c
+++ b/test/tselect.c
@@ -2227,8 +2227,8 @@ test_select_hyper_union(void)
dataset=H5Dcreate(fid1,"Dataset4",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
CHECK(dataset, FAIL, "H5Dcreate");
- xfer = H5Pcreate (H5P_DATASET_XFER);
- CHECK(xfer, FAIL, "H5Pcreate");
+ xfer = H5Pcreate_list (H5P_DATASET_XFER_NEW);
+ CHECK(xfer, FAIL, "H5Pcreate_list");
ret = H5Pset_hyper_cache(xfer,0,1);
CHECK(ret, FAIL, "H5Pset_hyper_cache");
@@ -2258,7 +2258,7 @@ test_select_hyper_union(void)
CHECK(ret, FAIL, "H5Dread");
/* Close transfer property list */
- ret = H5Pclose(xfer);
+ ret = H5Pclose_list(xfer);
CHECK(ret, FAIL, "H5Pclose");
/* Compare data read with data written out */
@@ -3170,7 +3170,7 @@ test_select(void)
MESSAGE(5, ("Testing Selections\n"));
/* Create a dataset transfer property list */
- plist_id=H5Pcreate(H5P_DATASET_XFER);
+ plist_id=H5Pcreate_list(H5P_DATASET_XFER_NEW);
CHECK(plist_id, FAIL, "H5Pcreate");
/* test I/O with a very small buffer for reads */
@@ -3231,7 +3231,7 @@ test_select(void)
CHECK(ret, FAIL, "H5Pclose");
/* Close dataset transfer property list */
- ret=H5Pclose(plist_id);
+ ret=H5Pclose_list(plist_id);
CHECK(ret, FAIL, "H5Pclose");
} /* test_select() */
diff --git a/test/tvlstr.c b/test/tvlstr.c
index 2ed5bb7..ccf51d3 100644
--- a/test/tvlstr.c
+++ b/test/tvlstr.c
@@ -154,7 +154,7 @@ test_vlstrings_basic(void)
CHECK(ret, FAIL, "H5Dwrite");
/* Change to the custom memory allocation routines for reading VL string */
- xfer_pid=H5Pcreate(H5P_DATASET_XFER);
+ xfer_pid=H5Pcreate_list(H5P_DATASET_XFER_NEW);
CHECK(xfer_pid, FAIL, "H5Pcreate");
ret=H5Pset_vlen_mem_manager(xfer_pid,test_vlstr_alloc_custom,&mem_used,test_vlstr_free_custom,&mem_used);
@@ -212,7 +212,7 @@ test_vlstrings_basic(void)
CHECK(ret, FAIL, "H5Sclose");
/* Close dataset transfer property list */
- ret = H5Pclose(xfer_pid);
+ ret = H5Pclose_list(xfer_pid);
CHECK(ret, FAIL, "H5Pclose");
/* Close file */
diff --git a/test/tvltypes.c b/test/tvltypes.c
index 8fb6b9a..00179e4 100644
--- a/test/tvltypes.c
+++ b/test/tvltypes.c
@@ -149,7 +149,7 @@ test_vltypes_vlen_atomic(void)
CHECK(ret, FAIL, "H5Dwrite");
/* Change to the custom memory allocation routines for reading VL data */
- xfer_pid=H5Pcreate(H5P_DATASET_XFER);
+ xfer_pid=H5Pcreate_list(H5P_DATASET_XFER_NEW);
CHECK(xfer_pid, FAIL, "H5Pcreate");
ret=H5Pset_vlen_mem_manager(xfer_pid,test_vltypes_alloc_custom,&mem_used,test_vltypes_free_custom,&mem_used);
@@ -210,7 +210,7 @@ test_vltypes_vlen_atomic(void)
CHECK(ret, FAIL, "H5Sclose");
/* Close dataset transfer property list */
- ret = H5Pclose(xfer_pid);
+ ret = H5Pclose_list(xfer_pid);
CHECK(ret, FAIL, "H5Pclose");
/* Close file */
@@ -289,7 +289,7 @@ test_vltypes_vlen_compound(void)
CHECK(ret, FAIL, "H5Dwrite");
/* Change to the custom memory allocation routines for reading VL data */
- xfer_pid=H5Pcreate(H5P_DATASET_XFER);
+ xfer_pid=H5Pcreate_list(H5P_DATASET_XFER_NEW);
CHECK(xfer_pid, FAIL, "H5Pcreate");
ret=H5Pset_vlen_mem_manager(xfer_pid,test_vltypes_alloc_custom,&mem_used,test_vltypes_free_custom,&mem_used);
@@ -359,7 +359,7 @@ test_vltypes_vlen_compound(void)
CHECK(ret, FAIL, "H5Sclose");
/* Close dataset transfer property list */
- ret = H5Pclose(xfer_pid);
+ ret = H5Pclose_list(xfer_pid);
CHECK(ret, FAIL, "H5Pclose");
/* Close file */
@@ -441,7 +441,7 @@ test_vltypes_compound_vlen_atomic(void)
CHECK(ret, FAIL, "H5Dwrite");
/* Change to the custom memory allocation routines for reading VL data */
- xfer_pid=H5Pcreate(H5P_DATASET_XFER);
+ xfer_pid=H5Pcreate_list(H5P_DATASET_XFER_NEW);
CHECK(xfer_pid, FAIL, "H5Pcreate");
ret=H5Pset_vlen_mem_manager(xfer_pid,test_vltypes_alloc_custom,&mem_used,test_vltypes_free_custom,&mem_used);
@@ -516,7 +516,7 @@ test_vltypes_compound_vlen_atomic(void)
CHECK(ret, FAIL, "H5Sclose");
/* Close dataset transfer property list */
- ret = H5Pclose(xfer_pid);
+ ret = H5Pclose_list(xfer_pid);
CHECK(ret, FAIL, "H5Pclose");
/* Close file */
@@ -658,7 +658,7 @@ test_vltypes_vlen_vlen_atomic(void)
CHECK(dataset, FAIL, "H5Dopen");
/* Change to the custom memory allocation routines for reading VL data */
- xfer_pid=H5Pcreate(H5P_DATASET_XFER);
+ xfer_pid=H5Pcreate_list(H5P_DATASET_XFER_NEW);
CHECK(xfer_pid, FAIL, "H5Pcreate");
ret=H5Pset_vlen_mem_manager(xfer_pid,test_vltypes_alloc_custom,&mem_used,test_vltypes_free_custom,&mem_used);
@@ -732,7 +732,7 @@ test_vltypes_vlen_vlen_atomic(void)
CHECK(ret, FAIL, "H5Sclose");
/* Close dataset transfer property list */
- ret = H5Pclose(xfer_pid);
+ ret = H5Pclose_list(xfer_pid);
CHECK(ret, FAIL, "H5Pclose");
/* Close file */