diff options
Diffstat (limited to 'test/trefer.c')
-rw-r--r-- | test/trefer.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/test/trefer.c b/test/trefer.c index 66c85d1..e265718 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -82,8 +82,9 @@ test_reference_obj(void) hobj_ref_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf; /* temp. buffer read from disk */ + hobj_ref_t nvrbuf[3]={0,100,1000000000}; /* buffer with non-valid refs */ unsigned *tu32; /* Temporary pointer to uint32 data */ - int i; /* counting variables */ + int i, j; /* counting variables */ const char *write_comment="Foo!"; /* Comments for group */ char read_comment[10]; herr_t ret; /* Generic return value */ @@ -270,6 +271,17 @@ test_reference_obj(void) VERIFY(ret, 3, "H5Tget_nmembers"); } + /* Attempting to retrieve type of object using non-valid refs */ + for (j=0; j<3; j++){ +#ifdef H5_WANT_H5_V1_4_COMPAT + ret = H5Rget_object_type(dataset,&nvrbuf[j]); + VERIFY(ret, H5G_UNKNOWN, "H5Rget_object_type"); +#else /* H5_WANT_H5_V1_4_COMPAT */ + ret = H5Rget_obj_type(dataset,H5R_OBJECT,&nvrbuf[j]); + VERIFY(ret, H5G_UNKNOWN, "H5Rget_obj_type"); +#endif /* H5_WANT_H5_V1_4_COMPAT */ + } + /* Close datatype */ ret = H5Tclose(tid1); CHECK(ret, FAIL, "H5Tclose"); @@ -314,10 +326,11 @@ test_reference_region(void) hsize_t high[SPACE2_RANK]; /* Selection bounds */ hdset_reg_ref_t *wbuf, /* buffer to write to disk */ *rbuf; /* buffer read from disk */ + hdset_reg_ref_t nvrbuf[3]={0,100,1000000000}; /* buffer with non-valid refs */ uint8_t *dwbuf, /* Buffer for writing numeric data to disk */ *drbuf; /* Buffer for reading numeric data from disk */ uint8_t *tu8; /* Temporary pointer to uint8 data */ - int i; /* counting variables */ + int i, j; /* counting variables */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -534,6 +547,17 @@ test_reference_region(void) ret = H5Dclose(dset2); CHECK(ret, FAIL, "H5Dclose"); + /* Attempting to retrieve type of object using non-valid refs */ + for (j=0; j<3; j++){ +#ifdef H5_WANT_H5_V1_4_COMPAT + ret = H5Rget_object_type(dset1,&nvrbuf[j]); + VERIFY(ret, H5G_UNKNOWN, "H5Rget_object_type"); +#else /* H5_WANT_H5_V1_4_COMPAT */ + ret = H5Rget_obj_type(dset1,H5R_DATASET_REGION,&nvrbuf[j]); + VERIFY(ret, H5G_UNKNOWN, "H5Rget_obj_type"); +#endif /* H5_WANT_H5_V1_4_COMPAT */ + } + /* Close Dataset */ ret = H5Dclose(dset1); CHECK(ret, FAIL, "H5Dclose"); |