summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2000-11-14 00:06:14 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2000-11-14 00:06:14 (GMT)
commitf71306c9d8f43059c267090cbbfbfd6f18e3e619 (patch)
tree1681d0cd8c4d88f3d4e2927ee2b732b30d4c9c10
parent3ddb574eb73c58365aa3218db692fd082db5dcc1 (diff)
downloadhdf5-f71306c9d8f43059c267090cbbfbfd6f18e3e619.zip
hdf5-f71306c9d8f43059c267090cbbfbfd6f18e3e619.tar.gz
hdf5-f71306c9d8f43059c267090cbbfbfd6f18e3e619.tar.bz2
[svn-r2893] Purpose:
Code development Description: Starting to implement actual tests for generic property lists. Platforms tested: FreeBSD 4.1.1 (hawkwind)
-rw-r--r--test/tgenprop.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/test/tgenprop.c b/test/tgenprop.c
index ecd170c..3fb2b3a 100644
--- a/test/tgenprop.c
+++ b/test/tgenprop.c
@@ -30,6 +30,60 @@ static char RcsId[] = "$Revision$";
#define FILENAME "tgenprop.h5"
+#define CLASS1_NAME "Class 1"
+#define CLASS1_HASHSIZE 25
+
+/****************************************************************
+**
+** test_genprop_basic_class(): Test basic generic property list code.
+** Tests creating new generic classes.
+**
+****************************************************************/
+static void
+test_genprop_basic_class(void)
+{
+ hid_t cid1; /* Generic Property class ID */
+ char *name; /* Name of class */
+ herr_t ret; /* Generic return value */
+
+ /* Output message about test being performed */
+ 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);
+ CHECK_I(cid1, "H5Pcreate_class");
+
+ /* Check class name */
+ name = H5Pget_class_name(cid1);
+ CHECK_PTR(name, "H5Pget_class_name");
+ if(HDstrcmp(name,CLASS1_NAME)!=0) {
+ num_errs++;
+ printf("Class names don't match!, name=%s, CLASS1_NAME=%s\n",name,CLASS1_NAME);
+ } /* end if */
+ free(name);
+
+ /* Close class */
+ ret = H5Pclose_class(cid1);
+ CHECK_I(ret, "H5Pclose_class");
+
+ /* Create a new generic class, derived from file creation class */
+ cid1 = H5Pcreate_class(H5P_FILE_CREATE_NEW,CLASS1_NAME,CLASS1_HASHSIZE,NULL,NULL,NULL,NULL);
+ CHECK_I(cid1, "H5Pcreate_class");
+
+ /* Check class name */
+ name = H5Pget_class_name(cid1);
+ CHECK_PTR(name, "H5Pget_class_name");
+ if(HDstrcmp(name,CLASS1_NAME)!=0) {
+ num_errs++;
+ printf("Class names don't match!, name=%s, CLASS1_NAME=%s\n",name,CLASS1_NAME);
+ } /* end if */
+ free(name);
+
+ /* Close class */
+ ret = H5Pclose_class(cid1);
+ CHECK_I(ret, "H5Pclose_class");
+} /* end test_genprop_basic_class() */
+
/****************************************************************
**
** test_genprop(): Main generic property testing routine.
@@ -42,6 +96,7 @@ test_genprop(void)
MESSAGE(5, ("Testing Generic Properties\n"));
/* These tests use the same file... */
+ test_genprop_basic_class(); /* Test basic code for creating a generic class */
} /* test_genprop() */