summaryrefslogtreecommitdiffstats
path: root/test/tgenprop.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-10-08 17:16:07 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-10-08 17:16:07 (GMT)
commitec65ddbef69ca67f0b40f06e45694d8ea076692e (patch)
treebf3b2698e85a1073ea5d9a7ce4a561220c040e6d /test/tgenprop.c
parent7e5d420349ddab3b5e8b8e35293433d5b452a977 (diff)
downloadhdf5-ec65ddbef69ca67f0b40f06e45694d8ea076692e.zip
hdf5-ec65ddbef69ca67f0b40f06e45694d8ea076692e.tar.gz
hdf5-ec65ddbef69ca67f0b40f06e45694d8ea076692e.tar.bz2
[svn-r5964] Purpose:
Internal feature. Description: To complement the "get the class's path" functionality, there needs to be a way to open a generic property class with a path. Solution: Implement the "open a class by path" functionality. Also, add internal testing routines. Platforms tested: FreeBSD 4.6 (sleipnir) (too small for triple testing)
Diffstat (limited to 'test/tgenprop.c')
-rw-r--r--test/tgenprop.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/test/tgenprop.c b/test/tgenprop.c
index a12b1e9..bddbec9 100644
--- a/test/tgenprop.c
+++ b/test/tgenprop.c
@@ -26,6 +26,7 @@
#include "testhdf5.h"
#include "hdf5.h"
#include "H5Dprivate.h" /* For Dataset creation property list names */
+#include "H5Pprivate.h" /* For H5P testing functions */
#define FILENAME "tgenprop.h5"
@@ -524,10 +525,6 @@ test_genprop_basic_list(void)
cid1 = H5Pcreate_class(H5P_NO_CLASS,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL,NULL,NULL);
CHECK_I(cid1, "H5Pcreate_class");
- /* Create a the generic class again, should fail */
- cid2 = H5Pcreate_class(H5P_NO_CLASS,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL,NULL,NULL);
- VERIFY(cid2, FAIL, "H5Pcreate_class");
-
/* Add several properties (w/default values) */
/* Insert first property into class (with no callbacks) */
@@ -1433,6 +1430,7 @@ test_genprop_path(void)
{
hid_t cid1; /* Generic Property class ID */
hid_t cid2; /* Generic Property class ID */
+ hid_t cid3; /* Generic Property class ID */
char *path; /* Class path */
herr_t ret; /* Generic return value */
@@ -1448,8 +1446,8 @@ test_genprop_path(void)
CHECK_I(ret, "H5Pregister");
/* Get full path for first class */
- path=H5Pget_class_path_test(cid1);
- CHECK_PTR(path, "H5Pget_class_path_test");
+ path=H5P_get_class_path_test(cid1);
+ CHECK_PTR(path, "H5P_get_class_path_test");
if(HDstrcmp(path,CLASS1_PATH)!=0) {
num_errs++;
printf("Class names don't match!, path=%s, CLASS1_PATH=%s\n",path,CLASS1_PATH);
@@ -1465,15 +1463,29 @@ test_genprop_path(void)
CHECK_I(ret, "H5Pregister");
/* Get full path for second class */
- path=H5Pget_class_path_test(cid2);
- CHECK_PTR(path, "H5Pget_class_path_test");
+ path=H5P_get_class_path_test(cid2);
+ CHECK_PTR(path, "H5P_get_class_path_test");
if(HDstrcmp(path,CLASS2_PATH)!=0) {
num_errs++;
printf("Class names don't match!, path=%s, CLASS2_PATH=%s\n",path,CLASS2_PATH);
} /* end if */
+
+ /* Open a copy of the class with the path name */
+ cid3 = H5P_open_class_path_test(path);
+ CHECK_I(cid3, "H5Popen_class_path");
+
+ /* Check that the classes are equal */
+ ret = H5Pequal(cid2,cid3);
+ VERIFY(ret, 1, "H5Pequal");
+
+ /* Release the path string */
free(path);
/* Close class */
+ ret = H5Pclose_class(cid3);
+ CHECK_I(ret, "H5Pclose_class");
+
+ /* Close class */
ret = H5Pclose_class(cid1);
CHECK_I(ret, "H5Pclose_class");