summaryrefslogtreecommitdiffstats
path: root/test/links.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-10-30 21:57:50 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-10-30 21:57:50 (GMT)
commitc136b81140106231e471b334bc5248611cec04e6 (patch)
tree0037e64ba84267eac89e0fcd4db0bd5cf6161ff5 /test/links.c
parentf85474466864d1a8b675387b623bebd89bbdc57e (diff)
downloadhdf5-c136b81140106231e471b334bc5248611cec04e6.zip
hdf5-c136b81140106231e471b334bc5248611cec04e6.tar.gz
hdf5-c136b81140106231e471b334bc5248611cec04e6.tar.bz2
[svn-r14223] Description:
Change existing H5Gget_info -> H5Gget_info_by_name and add new version of H5Gget_info, with simpler parameters, to better match new API routines. Tested on: FreeBSD/32 6.2 (duty) in debug mode FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Mac OS X/32 10.4.10 (amazon) in debug mode
Diffstat (limited to 'test/links.c')
-rw-r--r--test/links.c188
1 files changed, 172 insertions, 16 deletions
diff --git a/test/links.c b/test/links.c
index 1675d44..ce3714f 100644
--- a/test/links.c
+++ b/test/links.c
@@ -1456,7 +1456,7 @@ error:
/*-------------------------------------------------------------------------
- * Function: test_compat
+ * Function: test_deprec
*
* Purpose: Tests deprecated functions for backward compatibility.
*
@@ -1472,7 +1472,7 @@ error:
*/
#ifndef H5_NO_DEPRECATED_SYMBOLS
static int
-test_compat(hid_t fapl, hbool_t new_format)
+test_deprec(hid_t fapl, hbool_t new_format)
{
hid_t file_id = -1;
hid_t group1_id = -1;
@@ -1592,7 +1592,7 @@ error:
H5Fclose(file_id);
} H5E_END_TRY;
return 1;
-} /* end test_compat() */
+} /* end test_deprec() */
#endif /* H5_NO_DEPRECATED_SYMBOLS */
@@ -8990,14 +8990,32 @@ group_info(hid_t fapl)
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) TEST_ERROR
+
+ /* Retrieve group's information */
+ if(H5Gget_info(group_id2, &grp_info) < 0) TEST_ERROR
+
+ /* Check (new/empty) group's information */
+ if(grp_info.storage_type != H5G_STORAGE_TYPE_COMPACT) TEST_ERROR
+ if(grp_info.max_corder != 0) TEST_ERROR
+ if(grp_info.nlinks != 0) TEST_ERROR
+
/* Retrieve group's information */
- if(H5Gget_info(group_id2, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Gget_info_by_name(group_id, objname, &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
/* Check (new/empty) group's information */
if(grp_info.storage_type != H5G_STORAGE_TYPE_COMPACT) TEST_ERROR
if(grp_info.max_corder != 0) TEST_ERROR
if(grp_info.nlinks != 0) TEST_ERROR
+ /* Retrieve group's information */
+ if(H5Gget_info_by_name(group_id2, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Check (new/empty) group's information */
+ if(grp_info.storage_type != H5G_STORAGE_TYPE_COMPACT) TEST_ERROR
+ if(grp_info.max_corder != 0) TEST_ERROR
+ if(grp_info.nlinks != 0) TEST_ERROR
+
+
/* Create objects in new group created */
for(v = 0; v <= u; v++) {
/* Make name for link */
@@ -9010,8 +9028,17 @@ group_info(hid_t fapl)
if(H5Gclose(group_id3) < 0) TEST_ERROR
} /* end for */
+
+ /* Retrieve group's information */
+ if(H5Gget_info(group_id2, &grp_info) < 0) TEST_ERROR
+
+ /* Check (new) group's information */
+ if(grp_info.storage_type != H5G_STORAGE_TYPE_COMPACT) TEST_ERROR
+ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR
+ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR
+
/* Retrieve group's information */
- if(H5Gget_info(group_id2, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Gget_info_by_name(group_id, objname, &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
/* Check (new) group's information */
if(grp_info.storage_type != H5G_STORAGE_TYPE_COMPACT) TEST_ERROR
@@ -9019,6 +9046,15 @@ group_info(hid_t fapl)
if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR
/* Retrieve group's information */
+ if(H5Gget_info_by_name(group_id2, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Check (new) group's information */
+ if(grp_info.storage_type != H5G_STORAGE_TYPE_COMPACT) TEST_ERROR
+ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR
+ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR
+
+
+ /* Retrieve group's information */
if(order != H5_ITER_NATIVE) {
if(order == H5_ITER_INC) {
if(H5Gget_info_by_idx(group_id, ".", idx_type, order, (hsize_t)u, &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
@@ -9037,8 +9073,24 @@ group_info(hid_t fapl)
if(H5Gclose(group_id2) < 0) TEST_ERROR
+ /* Retrieve main group's information */
+ if(H5Gget_info(group_id, &grp_info) < 0) TEST_ERROR
+
+ /* Check main group's information */
+ if(grp_info.storage_type != H5G_STORAGE_TYPE_COMPACT) TEST_ERROR
+ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR
+ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR
+
+ /* Retrieve main group's information, by name */
+ if(H5Gget_info_by_name(file_id, CORDER_GROUP_NAME, &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Check main group's information */
+ if(grp_info.storage_type != H5G_STORAGE_TYPE_COMPACT) TEST_ERROR
+ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR
+ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR
+
/* Retrieve main group's information, by name */
- if(H5Gget_info(group_id, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Gget_info_by_name(group_id, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
/* Check main group's information */
if(grp_info.storage_type != H5G_STORAGE_TYPE_COMPACT) TEST_ERROR
@@ -9051,7 +9103,7 @@ group_info(hid_t fapl)
if(H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Retrieve soft link group's information, by name */
- if(H5Gget_info(soft_group_id, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Gget_info(soft_group_id, &grp_info) < 0) TEST_ERROR
/* Check soft link group's information */
if(grp_info.storage_type != H5G_STORAGE_TYPE_COMPACT) TEST_ERROR
@@ -9079,14 +9131,32 @@ group_info(hid_t fapl)
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0) TEST_ERROR
+
/* Retrieve group's information */
- if(H5Gget_info(group_id2, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Gget_info(group_id2, &grp_info) < 0) TEST_ERROR
+
+ /* Check (new/empty) group's information */
+ if(grp_info.storage_type != H5G_STORAGE_TYPE_COMPACT) TEST_ERROR
+ if(grp_info.max_corder != 0) TEST_ERROR
+ if(grp_info.nlinks != 0) TEST_ERROR
+
+ /* Retrieve group's information, by name */
+ if(H5Gget_info_by_name(group_id, objname, &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Check (new/empty) group's information */
+ if(grp_info.storage_type != H5G_STORAGE_TYPE_COMPACT) TEST_ERROR
+ if(grp_info.max_corder != 0) TEST_ERROR
+ if(grp_info.nlinks != 0) TEST_ERROR
+
+ /* Retrieve group's information, by name */
+ if(H5Gget_info_by_name(group_id2, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
/* Check (new/empty) group's information */
if(grp_info.storage_type != H5G_STORAGE_TYPE_COMPACT) TEST_ERROR
if(grp_info.max_corder != 0) TEST_ERROR
if(grp_info.nlinks != 0) TEST_ERROR
+
/* Create objects in new group created */
for(v = 0; v <= u; v++) {
/* Make name for link */
@@ -9099,14 +9169,32 @@ group_info(hid_t fapl)
if(H5Gclose(group_id3) < 0) TEST_ERROR
} /* end for */
+
/* Retrieve group's information */
- if(H5Gget_info(group_id2, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Gget_info(group_id2, &grp_info) < 0) TEST_ERROR
/* Check (new) group's information */
if(grp_info.storage_type != H5G_STORAGE_TYPE_DENSE) TEST_ERROR
if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR
if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR
+ /* Retrieve group's information, by name */
+ if(H5Gget_info_by_name(group_id, objname, &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Check (new) group's information */
+ if(grp_info.storage_type != H5G_STORAGE_TYPE_DENSE) TEST_ERROR
+ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR
+ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR
+
+ /* Retrieve group's information, by name */
+ if(H5Gget_info_by_name(group_id2, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Check (new) group's information */
+ if(grp_info.storage_type != H5G_STORAGE_TYPE_DENSE) TEST_ERROR
+ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR
+ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR
+
+
/* Retrieve group's information */
if(order != H5_ITER_NATIVE) {
if(order == H5_ITER_INC) {
@@ -9126,8 +9214,24 @@ group_info(hid_t fapl)
if(H5Gclose(group_id2) < 0) TEST_ERROR
+ /* Retrieve main group's information */
+ if(H5Gget_info(group_id, &grp_info) < 0) TEST_ERROR
+
+ /* Check main group's information */
+ if(grp_info.storage_type != H5G_STORAGE_TYPE_DENSE) TEST_ERROR
+ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR
+ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR
+
+ /* Retrieve main group's information, by name */
+ if(H5Gget_info_by_name(file_id, CORDER_GROUP_NAME, &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Check main group's information */
+ if(grp_info.storage_type != H5G_STORAGE_TYPE_DENSE) TEST_ERROR
+ if(grp_info.max_corder != (int64_t)(u + 1)) TEST_ERROR
+ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR
+
/* Retrieve main group's information, by name */
- if(H5Gget_info(group_id, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Gget_info_by_name(group_id, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
/* Check main group's information */
if(grp_info.storage_type != H5G_STORAGE_TYPE_DENSE) TEST_ERROR
@@ -9140,7 +9244,7 @@ group_info(hid_t fapl)
if(H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Retrieve soft link group's information, by name */
- if(H5Gget_info(soft_group_id, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Gget_info(soft_group_id, &grp_info) < 0) TEST_ERROR
/* Check soft link group's information */
if(grp_info.storage_type != H5G_STORAGE_TYPE_DENSE) TEST_ERROR
@@ -9257,14 +9361,32 @@ group_info_old(hid_t fapl)
/* Create hard link, with group object */
if((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+
/* Retrieve group's information */
- if(H5Gget_info(group_id2, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Gget_info(group_id2, &grp_info) < 0) TEST_ERROR
+
+ /* Check (new/empty) group's information */
+ if(grp_info.storage_type != H5G_STORAGE_TYPE_SYMBOL_TABLE) TEST_ERROR
+ if(grp_info.max_corder != 0) TEST_ERROR
+ if(grp_info.nlinks != 0) TEST_ERROR
+
+ /* Retrieve group's information, by name */
+ if(H5Gget_info_by_name(group_id, objname, &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
/* Check (new/empty) group's information */
if(grp_info.storage_type != H5G_STORAGE_TYPE_SYMBOL_TABLE) TEST_ERROR
if(grp_info.max_corder != 0) TEST_ERROR
if(grp_info.nlinks != 0) TEST_ERROR
+ /* Retrieve group's information, by name */
+ if(H5Gget_info_by_name(group_id2, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Check (new/empty) group's information */
+ if(grp_info.storage_type != H5G_STORAGE_TYPE_SYMBOL_TABLE) TEST_ERROR
+ if(grp_info.max_corder != 0) TEST_ERROR
+ if(grp_info.nlinks != 0) TEST_ERROR
+
+
/* Create objects in new group created */
for(v = 0; v <= u; v++) {
/* Make name for link */
@@ -9277,14 +9399,32 @@ group_info_old(hid_t fapl)
if(H5Gclose(group_id3) < 0) TEST_ERROR
} /* end for */
+
/* Retrieve group's information */
- if(H5Gget_info(group_id2, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Gget_info(group_id2, &grp_info) < 0) TEST_ERROR
+
+ /* Check (new) group's information */
+ if(grp_info.storage_type != H5G_STORAGE_TYPE_SYMBOL_TABLE) TEST_ERROR
+ if(grp_info.max_corder != 0) TEST_ERROR
+ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR
+
+ /* Retrieve group's information, by name */
+ if(H5Gget_info_by_name(group_id, objname, &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
/* Check (new) group's information */
if(grp_info.storage_type != H5G_STORAGE_TYPE_SYMBOL_TABLE) TEST_ERROR
if(grp_info.max_corder != 0) TEST_ERROR
if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR
+ /* Retrieve group's information, by name */
+ if(H5Gget_info_by_name(group_id2, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Check (new) group's information */
+ if(grp_info.storage_type != H5G_STORAGE_TYPE_SYMBOL_TABLE) TEST_ERROR
+ if(grp_info.max_corder != 0) TEST_ERROR
+ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR
+
+
/* Retrieve group's information */
if(order != H5_ITER_NATIVE) {
if(order == H5_ITER_INC) {
@@ -9304,8 +9444,24 @@ group_info_old(hid_t fapl)
if(H5Gclose(group_id2) < 0) TEST_ERROR
+ /* Retrieve main group's information */
+ if(H5Gget_info(group_id, &grp_info) < 0) TEST_ERROR
+
+ /* Check main group's information */
+ if(grp_info.storage_type != H5G_STORAGE_TYPE_SYMBOL_TABLE) TEST_ERROR
+ if(grp_info.max_corder != 0) TEST_ERROR
+ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR
+
+ /* Retrieve main group's information, by name */
+ if(H5Gget_info_by_name(file_id, CORDER_GROUP_NAME, &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
+
+ /* Check main group's information */
+ if(grp_info.storage_type != H5G_STORAGE_TYPE_SYMBOL_TABLE) TEST_ERROR
+ if(grp_info.max_corder != 0) TEST_ERROR
+ if(grp_info.nlinks != (hsize_t)(u + 1)) TEST_ERROR
+
/* Retrieve main group's information, by name */
- if(H5Gget_info(group_id, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Gget_info_by_name(group_id, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
/* Check main group's information */
if(grp_info.storage_type != H5G_STORAGE_TYPE_SYMBOL_TABLE) TEST_ERROR
@@ -9318,7 +9474,7 @@ group_info_old(hid_t fapl)
if(H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
/* Retrieve soft link group's information, by name */
- if(H5Gget_info(soft_group_id, ".", &grp_info, H5P_DEFAULT) < 0) TEST_ERROR
+ if(H5Gget_info(soft_group_id, &grp_info) < 0) TEST_ERROR
/* Check soft link group's information */
if(grp_info.storage_type != H5G_STORAGE_TYPE_SYMBOL_TABLE) TEST_ERROR
@@ -9582,7 +9738,7 @@ main(void)
nerrors += test_copy((new_format ? fapl2 : fapl), new_format);
nerrors += test_move_preserves((new_format ? fapl2 : fapl), new_format);
#ifndef H5_NO_DEPRECATED_SYMBOLS
- nerrors += test_compat((new_format ? fapl2 : fapl), new_format);
+ nerrors += test_deprec((new_format ? fapl2 : fapl), new_format);
#endif /* H5_NO_DEPRECATED_SYMBOLS */
#ifndef H5_CANNOT_OPEN_TWICE
nerrors += external_link_root((new_format ? fapl2 : fapl), new_format) < 0 ? 1 : 0;