summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-11-07 17:06:42 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-11-07 17:06:42 (GMT)
commitde285fb90913bdc8a67f9a226de1b3d7ebd805db (patch)
treef484dd0c05c936beca33094365fbb956071e6a7c /test
parentc17b59ac25391c0f8ad5d5778c07c2185c3cea2c (diff)
downloadhdf5-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')
-rw-r--r--test/Makefile.am4
-rw-r--r--test/Makefile.in8
-rw-r--r--test/getname.c6
-rw-r--r--test/links.c2
-rw-r--r--test/ref.c14
5 files changed, 23 insertions, 11 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index b311e40..450d28e 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -40,8 +40,8 @@ TEST_PROG=testhdf5 lheap ohdr stab gheap cache cache_api \
dtypes dsets cmpd_dset extend external objcopy links unlink big mtime \
fillval mount flush1 flush2 enum \
set_extent ttsafe stream_test \
- getname vfd ntypes dangle dtransform reserved cross_read \
- btree2 fheap ref
+ getname ref vfd ntypes dangle dtransform reserved cross_read \
+ btree2 fheap
# List programs to be built when testing here. error_test and err_compat are
# built at the same time as the other tests, but executed by testerror.sh.
diff --git a/test/Makefile.in b/test/Makefile.in
index ee2a028..082bf2f 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -82,9 +82,9 @@ am__EXEEXT_1 = testhdf5$(EXEEXT) lheap$(EXEEXT) ohdr$(EXEEXT) \
unlink$(EXEEXT) big$(EXEEXT) mtime$(EXEEXT) fillval$(EXEEXT) \
mount$(EXEEXT) flush1$(EXEEXT) flush2$(EXEEXT) enum$(EXEEXT) \
set_extent$(EXEEXT) ttsafe$(EXEEXT) stream_test$(EXEEXT) \
- getname$(EXEEXT) vfd$(EXEEXT) ntypes$(EXEEXT) dangle$(EXEEXT) \
+ getname$(EXEEXT) ref$(EXEEXT) vfd$(EXEEXT) ntypes$(EXEEXT) dangle$(EXEEXT) \
dtransform$(EXEEXT) reserved$(EXEEXT) cross_read$(EXEEXT) \
- btree2$(EXEEXT) fheap$(EXEEXT) ref$(EXEEXT)
+ btree2$(EXEEXT) fheap$(EXEEXT)
am__EXEEXT_2 = gen_deflate$(EXEEXT) gen_filters$(EXEEXT) \
gen_new_array$(EXEEXT) gen_new_fill$(EXEEXT) \
gen_new_group$(EXEEXT) gen_new_mtime$(EXEEXT) \
@@ -632,8 +632,8 @@ TEST_PROG = testhdf5 lheap ohdr stab gheap cache cache_api \
dtypes dsets cmpd_dset extend external objcopy links unlink big mtime \
fillval mount flush1 flush2 enum \
set_extent ttsafe stream_test \
- getname vfd ntypes dangle dtransform reserved cross_read \
- btree2 fheap ref
+ getname ref vfd ntypes dangle dtransform reserved cross_read \
+ btree2 fheap
# These programs generate test files for the tests. They don't need to be
diff --git a/test/getname.c b/test/getname.c
index 07e7bcf..5a6c176 100644
--- a/test/getname.c
+++ b/test/getname.c
@@ -818,7 +818,7 @@ int main( void )
/* Verify */
if(check_name(group_id, "/g14/g3/g4", "") < 0) TEST_ERROR;
- if(check_name(group2_id, "", "") < 0) TEST_ERROR;
+ if(check_name(group2_id, "/", "") < 0) TEST_ERROR;
/* Close */
H5Gclose( group_id );
@@ -860,7 +860,7 @@ int main( void )
if (H5Funmount(group2_id, ".")<0) TEST_ERROR;
/* Verify */
- if(check_name(group2_id, "", "") < 0) TEST_ERROR;
+ if(check_name(group2_id, "/", "") < 0) TEST_ERROR;
/* Close */
H5Gclose( group2_id );
@@ -902,7 +902,7 @@ int main( void )
if (H5Funmount(group2_id, ".")<0) TEST_ERROR;
/* Verify */
- if(check_name(group2_id, "", "") < 0) TEST_ERROR;
+ if(check_name(group2_id, "/", "") < 0) TEST_ERROR;
if(check_name(group3_id, "/g13/g1", "/g13/g1") < 0) TEST_ERROR;
/* Close */
diff --git a/test/links.c b/test/links.c
index 64ef6c0..9fa4221 100644
--- a/test/links.c
+++ b/test/links.c
@@ -1626,7 +1626,7 @@ external_link_root(hid_t fapl, hbool_t new_format)
/* Check name */
if((name_len = H5Iget_name( gid, objname, (size_t)NAME_BUF_SIZE )) < 0) TEST_ERROR
- if(name_len != 0) TEST_ERROR
+ if(HDstrcmp(objname, "/")) TEST_ERROR
/* Create object in external file */
if((gid2 = H5Gcreate(gid, "new_group", (size_t)0)) < 0) TEST_ERROR
diff --git a/test/ref.c b/test/ref.c
index c31f987..3ed7654 100644
--- a/test/ref.c
+++ b/test/ref.c
@@ -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