diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2009-04-28 18:47:06 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2009-04-28 18:47:06 (GMT) |
commit | 75a7a98214a0a408adff8b90b697682f10a4de77 (patch) | |
tree | 1bd4fb069755aecf333d611e07a687e7efa4bbc8 | |
parent | 466f884c1dad401e90c766a9cca80a045ed51513 (diff) | |
download | hdf5-75a7a98214a0a408adff8b90b697682f10a4de77.zip hdf5-75a7a98214a0a408adff8b90b697682f10a4de77.tar.gz hdf5-75a7a98214a0a408adff8b90b697682f10a4de77.tar.bz2 |
[svn-r16873] Removed debugging statements, tested early adoption of new error handling.
-rw-r--r-- | hl/src/H5HLerror.h | 3 | ||||
-rw-r--r-- | hl/src/H5LR.c | 23 | ||||
-rw-r--r-- | hl/src/Makefile.in | 4 | ||||
-rw-r--r-- | hl/test/test_regref_hyper.c | 20 |
4 files changed, 34 insertions, 16 deletions
diff --git a/hl/src/H5HLerror.h b/hl/src/H5HLerror.h index ff8c57c..0b98571 100644 --- a/hl/src/H5HLerror.h +++ b/hl/src/H5HLerror.h @@ -38,6 +38,9 @@ H5_DLLVAR hid_t H5HL_ERR_CLS_g; #define H5E_LREF (H5OPEN H5E_LREF_g) H5_DLLVAR hid_t H5E_LREF_g; /* Lite References */ +#define H5E_LT (H5OPEN H5E_LT_g) +H5_DLLVAR hid_t H5E_LT_g; /* HDF5 Lite */ + /*********************/ /* Minor error codes */ diff --git a/hl/src/H5LR.c b/hl/src/H5LR.c index 6303886..edbe2ac 100644 --- a/hl/src/H5LR.c +++ b/hl/src/H5LR.c @@ -128,11 +128,11 @@ H5LR__pkg_init(void)) if((H5HL_ERR_CLS_g = H5Eregister_class(ERR_CLS_NAME, PROG_NAME, lib_str)) < 0) TEST_ERROR; - if((H5_MY_PKG_ERR = H5Ecreate_msg(H5HL_ERR_CLS_g, H5E_MAJOR, ERR_MAJ_MSG)) < 0) - TEST_ERROR; +/* if((H5_MY_PKG_ERR = H5Ecreate_msg(H5HL_ERR_CLS_g, H5E_MAJOR, ERR_MAJ_MSG)) < 0) */ +/* TEST_ERROR; */ - if((ERR_MIN = H5Ecreate_msg(H5HL_ERR_CLS_g, H5E_MINOR, ERR_MIN_MSG)) < 0) - TEST_ERROR; +/* if((ERR_MIN = H5Ecreate_msg(H5HL_ERR_CLS_g, H5E_MINOR, ERR_MIN_MSG)) < 0) */ +/* TEST_ERROR; */ return 0; error: @@ -345,7 +345,6 @@ H5LRread_region(hid_t obj_id, /* -IN- Id. of any object in a hid_t dset = -1, file_space = -1; /* Identifier of the dataset's dataspace in the file */ hid_t mem_space = -1; /* Identifier of the memory dataspace */ - const char *FUNC_H5LRread_region = "H5LRread_region"; H5LR__pkg_init(); @@ -355,13 +354,19 @@ H5LRread_region(hid_t obj_id, /* -IN- Id. of any object in a } H5E_END_TRY; if(dset < 0) { -/* H5LR__pkg_msg("*1","*2*" ); */ - H5E_THROW(ERR_MIN, "HL: Unable to open object referenced") + H5_MY_PKG_ERR = H5E_REFERENCE; + H5E_THROW(H5E_NOTFOUND, "HL: Failed to open object referenced") } /* end if */ /* Retrieve the dataspace with the specified region selected */ - if((file_space = H5Rget_region(dset, H5R_DATASET_REGION, ref)) < 0) - H5E_THROW(H5E_CANTGET, "HL: Unable to retrieve region") + H5E_BEGIN_TRY { + file_space = H5Rget_region(dset, H5R_DATASET_REGION, ref); + } H5E_END_TRY; + + if(file_space < 0) { + H5_MY_PKG_ERR = H5E_REFERENCE; + H5E_THROW(H5E_CANTGET, "HL: Retrieving dataspace referenced failed") + } /* end if */ /* Check for anything to retrieve */ if(numelem || buf) { diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index faf3251..a2b88fc 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -72,8 +72,8 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" libLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) libhdf5_hl_la_LIBADD = -am_libhdf5_hl_la_OBJECTS = H5DS.lo H5HLerror.lo H5HLint.lo H5IM.lo H5LT.lo H5LTanalyze.lo \ - H5LTparse.lo H5PT.lo H5TB.lo H5LR.lo +am_libhdf5_hl_la_OBJECTS = H5DS.lo H5HLerror.lo H5HLint.lo H5IM.lo \ + H5LT.lo H5LTanalyze.lo H5LTparse.lo H5PT.lo H5TB.lo H5LR.lo libhdf5_hl_la_OBJECTS = $(am_libhdf5_hl_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/bin/depcomp diff --git a/hl/test/test_regref_hyper.c b/hl/test/test_regref_hyper.c index 8d43364..9d6f120 100644 --- a/hl/test/test_regref_hyper.c +++ b/hl/test/test_regref_hyper.c @@ -336,12 +336,13 @@ int main(void) /* Read a region of the data using a region reference */ +/* file_id = -1; */ - status = H5LRread_region(file_id, - &ref[1], - H5T_NATIVE_INT, - &numelem, - data_out2); + if ( H5LRread_region(file_id, + &ref[1], + H5T_NATIVE_INT, + &numelem, + data_out2) < 0) goto out; printf("REGION REFERENCED 2D HYPERSLAB (H5LRread_region),"); printf(" COORDINATES (%d,%d)-(%d,%d):\n", @@ -442,11 +443,18 @@ int main(void) /* check the data pointed to by the new region reference */ + status = H5LRread_region(file_id, &ref_new, H5T_NATIVE_INT, &numelem, data_out2); + + if(status<0){ + printf("\nH5LRread_region FAILED--STOPPING\n"); + abort(); + } + for (i=0; i<3; i++) { printf("\n [ "); @@ -480,6 +488,8 @@ int main(void) /* printf("%d %d %d %d \n ",i,j,k,data3D[i][j][k]); */ return 0; +out: + return 1; } |