diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2006-11-07 17:06:42 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2006-11-07 17:06:42 (GMT) |
commit | de285fb90913bdc8a67f9a226de1b3d7ebd805db (patch) | |
tree | f484dd0c05c936beca33094365fbb956071e6a7c /test/ref.c | |
parent | c17b59ac25391c0f8ad5d5778c07c2185c3cea2c (diff) | |
download | hdf5-de285fb90913bdc8a67f9a226de1b3d7ebd805db.zip hdf5-de285fb90913bdc8a67f9a226de1b3d7ebd805db.tar.gz hdf5-de285fb90913bdc8a67f9a226de1b3d7ebd805db.tar.bz2 |
[svn-r12875] Description:
Fix retrieving name for references to root group.
Also, move 'ref' test earlier in testing, right after 'getname' test
Tested on:
Linux/64 2.6 (chicago2)
Diffstat (limited to 'test/ref.c')
-rw-r--r-- | test/ref.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -34,7 +34,7 @@ /* 1-D dataset with fixed dimensions */ #define SPACE1_RANK 1 -#define SPACE1_DIM1 7 +#define SPACE1_DIM1 8 int main(void) @@ -184,6 +184,10 @@ main(void) if(H5Rcreate(&wbuf[6], fid1, "/Group1/Group2/Link/Dataset5", H5R_OBJECT, -1) < 0) TEST_ERROR + /* Create reference to root group */ + if(H5Rcreate(&wbuf[7], fid1, "/", H5R_OBJECT, -1) < 0) + TEST_ERROR + /* Write selection to disk */ if(H5Dwrite(dataset, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0) TEST_ERROR @@ -243,6 +247,14 @@ main(void) else TEST_ERROR + HDmemset(buf, 0, 100); + TESTING("getting path to root group"); + i = H5Iget_name(H5Rdereference(dataset, H5R_OBJECT , &wbuf[7]), (char*)buf, 100); + if((HDstrcmp(buf, "/") == 0) && (i == 2)) + PASSED() + else + TEST_ERROR + /* Now we mount fid2 at /Group2 and look for dataset4. It shouldn't be found */ if(H5Fmount(fid1, "/Group1/Group2", fid2, H5P_DEFAULT) < 0) TEST_ERROR |