summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2003-07-11 21:04:38 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2003-07-11 21:04:38 (GMT)
commit344eb1c83c19e552e281735782ec29d8b68d52df (patch)
tree05c370d16fa3adfc2c2a8580e030708b3e2d5ef4 /test
parent01e9075358e6b1212d45dd13613203110c8f5373 (diff)
downloadhdf5-344eb1c83c19e552e281735782ec29d8b68d52df.zip
hdf5-344eb1c83c19e552e281735782ec29d8b68d52df.tar.gz
hdf5-344eb1c83c19e552e281735782ec29d8b68d52df.tar.bz2
[svn-r7212] Purpose: New error API design is being checked gradually.
Platforms tested: RH 8
Diffstat (limited to 'test')
-rw-r--r--test/errors.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/test/errors.c b/test/errors.c
index dcd4e67..bd832d6 100644
--- a/test/errors.c
+++ b/test/errors.c
@@ -35,7 +35,7 @@ hid_t ERR_CLS;
hid_t ERR_MAJ_TEST;
hid_t ERR_MIN_SUBROUTINE;
-#define DSET_ATOMIC_NAME_1 "atomic_type_1"
+#define DSET_NAME "a_dataset"
#define ERR_CLS_NAME "Error Test"
#define PROG_NAME "Error Program"
@@ -90,7 +90,7 @@ test_error(hid_t file)
/*------------------- Test data values ------------------------*/
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_1, H5T_STD_I32BE, space,
+ if ((dataset = H5Dcreate(file, DSET_NAME, H5T_STD_I32BE, space,
H5P_DEFAULT))<0) TEST_ERROR;
/* Write the data to the dataset */
@@ -101,7 +101,7 @@ test_error(hid_t file)
if(H5Dclose(dataset)<0) TEST_ERROR;
/* Open dataset again to check H5Tget_native_type */
- if((dataset=H5Dopen(file, DSET_ATOMIC_NAME_1))<0) TEST_ERROR;
+ if((dataset=H5Dopen(file, DSET_NAME))<0) TEST_ERROR;
if((dtype=H5Dget_type(dataset))<0) TEST_ERROR;
@@ -172,18 +172,19 @@ test_error(hid_t file)
*
*-------------------------------------------------------------------------
*/
-#ifdef NEW_ERR
+#ifndef NEW_ERR
static herr_t
init_error(void)
{
if((ERR_CLS = H5Eregister_class(ERR_CLS_NAME, PROG_NAME, PROG_VERS))<0)
goto error;
-
+
+ /*
if((ERR_MAJ_TEST = H5Ecreate_mesg(ERR_CLS, H5E_MAJOR, "Error in test"))<0)
goto error;
if((ERR_MIN_SUBROUTINE = H5Ecreate_mesg(ERR_CLS, H5E_MINOR, "Error in subroutine"))<0)
goto error;
-
+ */
PASSED();
return 0;
@@ -211,29 +212,31 @@ main(void)
hid_t file, fapl;
char filename[1024];
const char *FUNC="main()";
+
+ h5_reset();
-#ifdef NEW_ERR
+#ifndef NEW_ERR
if(init_error()<0)
goto error;
#endif /* NEW_ERR */
- h5_reset();
fapl = h5_fileaccess();
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
goto error;
- if(test_error(file)<0) {
-#ifdef NEW_ERR
- H5Epush(H5E_DEFAULT, __FILE__, FUNC, __LINE__, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "Error test failed");
+ /*if(test_error(file)<0) {*/
+#ifndef NEW_ERR
+ /*H5Epush(H5E_DEFAULT, __FILE__, FUNC, __LINE__, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "Error test failed");*/
#endif /* NEW_ERR */
- goto error;
- }
+ /* goto error;
+ }*/
if (H5Fclose(file)<0) goto error;
printf("All error API test based on native datatype test passed.\n");
h5_cleanup(FILENAME, fapl);
+
return 0;
error: