summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2005-08-27 13:34:28 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2005-08-27 13:34:28 (GMT)
commitfefbe61aca1a42e716e900be7af5b382be5e19c1 (patch)
treedbb600c8b6555569a4d94ff69b24e72c4787693d /test
parent538d37a1bcc15a600c71fad0566d8480c2344ee6 (diff)
downloadhdf5-fefbe61aca1a42e716e900be7af5b382be5e19c1.zip
hdf5-fefbe61aca1a42e716e900be7af5b382be5e19c1.tar.gz
hdf5-fefbe61aca1a42e716e900be7af5b382be5e19c1.tar.bz2
[svn-r11304] Purpose:
Code cleanup (sorta) Description: Adjust H5G_stat_t to prepare for eventual "external link" information. This also puts the information for regular objects and soft links into more obviously separate places. Platforms tested: FreeBSD 4.11 (sleipnir) Linux 2.4
Diffstat (limited to 'test')
-rw-r--r--test/links.c8
-rw-r--r--test/mount.c4
-rw-r--r--test/mtime.c12
-rw-r--r--test/tattr.c14
-rw-r--r--test/tmisc.c32
-rw-r--r--test/unlink.c2
6 files changed, 36 insertions, 36 deletions
diff --git a/test/links.c b/test/links.c
index 7484211..8a89929 100644
--- a/test/links.c
+++ b/test/links.c
@@ -269,7 +269,7 @@ cklinks(hid_t fapl)
puts(" Unexpected object type should have been a dataset");
goto error;
}
- if (sb1.objno!=sb2.objno) {
+ if (sb1.u.obj.objno!=sb2.u.obj.objno) {
H5_FAILED();
puts(" Hard link test failed. Link seems not to point to the ");
puts(" expected file location.");
@@ -283,7 +283,7 @@ cklinks(hid_t fapl)
puts(" Unexpected object type should have been a dataset");
goto error;
}
- if (sb1.objno!=sb2.objno) {
+ if (sb1.u.obj.objno!=sb2.u.obj.objno) {
H5_FAILED();
puts(" Soft link test failed. Link seems not to point to the ");
puts(" expected file location.");
@@ -403,7 +403,7 @@ ck_new_links(hid_t fapl)
puts(" Unexpected object type, should have been a dataset");
goto error;
}
- if( sb_dset.objno!=sb_hard1.objno || sb_dset.objno!=sb_hard2.objno ) {
+ if( sb_dset.u.obj.objno!=sb_hard1.u.obj.objno || sb_dset.u.obj.objno!=sb_hard2.u.obj.objno ) {
H5_FAILED();
puts(" Hard link test failed. Link seems not to point to the ");
puts(" expected file location.");
@@ -421,7 +421,7 @@ ck_new_links(hid_t fapl)
goto error;
}
- if( sb_dset.objno!=sb_soft1.objno || sb_dset.objno!=sb_soft2.objno ) {
+ if( sb_dset.u.obj.objno!=sb_soft1.u.obj.objno || sb_dset.u.obj.objno!=sb_soft2.u.obj.objno ) {
H5_FAILED();
puts(" Soft link test failed. Link seems not to point to the ");
puts(" expected file location.");
diff --git a/test/mount.c b/test/mount.c
index 3b9d4ce..6c19143 100644
--- a/test/mount.c
+++ b/test/mount.c
@@ -293,7 +293,7 @@ test_hide(hid_t fapl)
* other names. This is a rather stupid test but demonstrates a point.
*/
if (H5Gget_objinfo(file1, "/file1", TRUE, &sb2)<0) goto error;
- if (sb1.fileno!=sb2.fileno || sb1.objno!=sb2.objno) {
+ if (sb1.fileno!=sb2.fileno || sb1.u.obj.objno!=sb2.u.obj.objno) {
H5_FAILED();
puts(" Hard link failed for hidden object.");
goto error;
@@ -360,7 +360,7 @@ test_assoc(hid_t fapl)
* of file2.
*/
if (H5Gget_objinfo(file1, "/mnt1", TRUE, &sb2)<0) goto error;
- if (sb1.fileno!=sb2.fileno || sb1.objno!=sb2.objno) {
+ if (sb1.fileno!=sb2.fileno || sb1.u.obj.objno!=sb2.u.obj.objno) {
H5_FAILED();
puts(" Association failed.");
goto error;
diff --git a/test/mtime.c b/test/mtime.c
index 18f0bbf..963ccb7 100644
--- a/test/mtime.c
+++ b/test/mtime.c
@@ -97,7 +97,7 @@ main(void)
if (H5Fclose(file)<0) TEST_ERROR;
/* Compare times from the two ways of calling H5Gget_objinfo() */
- if (sb1.objno!=sb2.objno || sb1.mtime!=sb2.mtime) {
+ if (sb1.u.obj.objno!=sb2.u.obj.objno || sb1.u.obj.mtime!=sb2.u.obj.mtime) {
H5_FAILED();
puts(" Calling H5Gget_objinfo() with the dataset ID returned");
puts(" different values than calling it with a file and dataset");
@@ -106,15 +106,15 @@ main(void)
}
/* Compare times -- they must be within 60 seconds of one another */
- if (0==sb1.mtime) {
+ if (0==sb1.u.obj.mtime) {
SKIPPED();
puts(" The modification time could not be decoded on this OS.");
puts(" Modification times will be mantained in the file but");
puts(" cannot be queried on this system. See H5O_mtime_decode().");
return 0;
- } else if (fabs(HDdifftime(now, sb1.mtime))>60.0) {
+ } else if (fabs(HDdifftime(now, sb1.u.obj.mtime))>60.0) {
H5_FAILED();
- tm = localtime(&(sb1.mtime));
+ tm = localtime(&(sb1.u.obj.mtime));
strftime((char*)buf1, sizeof buf1, "%Y-%m-%d %H:%M:%S", tm);
tm = localtime(&now);
strftime((char*)buf2, sizeof buf2, "%Y-%m-%d %H:%M:%S", tm);
@@ -140,7 +140,7 @@ main(void)
if (file >= 0){
if(H5Gget_objinfo(file, "/Dataset1", TRUE, &sb1)<0)
TEST_ERROR;
- if(sb1.mtime!=MTIME1) {
+ if(sb1.u.obj.mtime!=MTIME1) {
H5_FAILED();
/* If this fails, examine H5Omtime.c. Modification time is very
* system dependant (e.g., on Windows DST must be hardcoded). */
@@ -175,7 +175,7 @@ main(void)
if (file >= 0){
if(H5Gget_objinfo(file, "/Dataset1", TRUE, &sb2)<0)
TEST_ERROR;
- if(sb2.mtime!=MTIME2) {
+ if(sb2.u.obj.mtime!=MTIME2) {
H5_FAILED();
puts(" Modification time incorrect.");
goto error;
diff --git a/test/tattr.c b/test/tattr.c
index 4297316..dc82190 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -1433,7 +1433,7 @@ test_attr_dtype_shared(void)
/* Check reference count on named datatype */
ret=H5Gget_objinfo(file_id,TYPE1_NAME,0,&statbuf);
CHECK(ret, FAIL, "H5Gget_objinfo");
- VERIFY(statbuf.nlink, 1, "H5Tcommit");
+ VERIFY(statbuf.u.obj.nlink, 1, "H5Tcommit");
/* Create dataspace for dataset */
space_id=H5Screate(H5S_SCALAR);
@@ -1446,7 +1446,7 @@ test_attr_dtype_shared(void)
/* Check reference count on named datatype */
ret=H5Gget_objinfo(file_id,TYPE1_NAME,0,&statbuf);
CHECK(ret, FAIL, "H5Gget_objinfo");
- VERIFY(statbuf.nlink, 2, "H5Dcreate");
+ VERIFY(statbuf.u.obj.nlink, 2, "H5Dcreate");
/* Create attribute on dataset */
attr_id=H5Acreate(dset_id,ATTR1_NAME,type_id,space_id,H5P_DEFAULT);
@@ -1455,7 +1455,7 @@ test_attr_dtype_shared(void)
/* Check reference count on named datatype */
ret=H5Gget_objinfo(file_id,TYPE1_NAME,0,&statbuf);
CHECK(ret, FAIL, "H5Gget_objinfo");
- VERIFY(statbuf.nlink, 3, "H5Acreate");
+ VERIFY(statbuf.u.obj.nlink, 3, "H5Acreate");
/* Close attribute */
ret=H5Aclose(attr_id);
@@ -1468,7 +1468,7 @@ test_attr_dtype_shared(void)
/* Check reference count on named datatype */
ret=H5Gget_objinfo(file_id,TYPE1_NAME,0,&statbuf);
CHECK(ret, FAIL, "H5Gget_objinfo");
- VERIFY(statbuf.nlink, 2, "H5Adelete");
+ VERIFY(statbuf.u.obj.nlink, 2, "H5Adelete");
/* Create attribute on dataset */
attr_id=H5Acreate(dset_id,ATTR1_NAME,type_id,space_id,H5P_DEFAULT);
@@ -1477,7 +1477,7 @@ test_attr_dtype_shared(void)
/* Check reference count on named datatype */
ret=H5Gget_objinfo(file_id,TYPE1_NAME,0,&statbuf);
CHECK(ret, FAIL, "H5Gget_objinfo");
- VERIFY(statbuf.nlink, 3, "H5Acreate");
+ VERIFY(statbuf.u.obj.nlink, 3, "H5Acreate");
/* Write data into the attribute */
ret=H5Awrite(attr_id,H5T_NATIVE_INT,&data);
@@ -1531,7 +1531,7 @@ test_attr_dtype_shared(void)
/* Check reference count on named datatype */
ret=H5Gget_objinfo(file_id,TYPE1_NAME,0,&statbuf);
CHECK(ret, FAIL, "H5Gget_objinfo");
- VERIFY(statbuf.nlink, 3, "H5Aopen_name");
+ VERIFY(statbuf.u.obj.nlink, 3, "H5Aopen_name");
/* Unlink the dataset */
ret=H5Gunlink(file_id,DSET1_NAME);
@@ -1540,7 +1540,7 @@ test_attr_dtype_shared(void)
/* Check reference count on named datatype */
ret=H5Gget_objinfo(file_id,TYPE1_NAME,0,&statbuf);
CHECK(ret, FAIL, "H5Gget_objinfo");
- VERIFY(statbuf.nlink, 1, "H5Gunlink");
+ VERIFY(statbuf.u.obj.nlink, 1, "H5Gunlink");
/* Unlink the named datatype */
ret=H5Gunlink(file_id,TYPE1_NAME);
diff --git a/test/tmisc.c b/test/tmisc.c
index 6cc7556..d228452 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -2812,10 +2812,10 @@ test_misc18(void)
/* Get object information */
ret = H5Gget_objinfo(fid,MISC18_DSET1_NAME,0,&statbuf);
CHECK(ret, FAIL, "H5Gget_objinfo");
- VERIFY(statbuf.ohdr.nmesgs, 6, "H5Gget_objinfo");
- VERIFY(statbuf.ohdr.nchunks, 1, "H5Gget_objinfo");
- VERIFY(statbuf.ohdr.size, 272, "H5Gget_objinfo");
- VERIFY(statbuf.ohdr.free, 152, "H5Gget_objinfo");
+ VERIFY(statbuf.u.obj.ohdr.nmesgs, 6, "H5Gget_objinfo");
+ VERIFY(statbuf.u.obj.ohdr.nchunks, 1, "H5Gget_objinfo");
+ VERIFY(statbuf.u.obj.ohdr.size, 272, "H5Gget_objinfo");
+ VERIFY(statbuf.u.obj.ohdr.free, 152, "H5Gget_objinfo");
/* Create second dataset */
did2 = H5Dcreate(fid, MISC18_DSET2_NAME, H5T_STD_U32LE, sid, H5P_DEFAULT);
@@ -2824,10 +2824,10 @@ test_misc18(void)
/* Get object information */
ret = H5Gget_objinfo(fid,MISC18_DSET2_NAME,0,&statbuf);
CHECK(ret, FAIL, "H5Gget_objinfo");
- VERIFY(statbuf.ohdr.nmesgs, 6, "H5Gget_objinfo");
- VERIFY(statbuf.ohdr.nchunks, 1, "H5Gget_objinfo");
- VERIFY(statbuf.ohdr.size, 272, "H5Gget_objinfo");
- VERIFY(statbuf.ohdr.free, 152, "H5Gget_objinfo");
+ VERIFY(statbuf.u.obj.ohdr.nmesgs, 6, "H5Gget_objinfo");
+ VERIFY(statbuf.u.obj.ohdr.nchunks, 1, "H5Gget_objinfo");
+ VERIFY(statbuf.u.obj.ohdr.size, 272, "H5Gget_objinfo");
+ VERIFY(statbuf.u.obj.ohdr.free, 152, "H5Gget_objinfo");
/* Loop creating attributes on each dataset, flushing them to the file each time */
for(u=0; u<10; u++) {
@@ -2856,18 +2856,18 @@ test_misc18(void)
/* Get object information for dataset #1 now */
ret = H5Gget_objinfo(fid,MISC18_DSET1_NAME,0,&statbuf);
CHECK(ret, FAIL, "H5Gget_objinfo");
- VERIFY(statbuf.ohdr.nmesgs, 24, "H5Gget_objinfo");
- VERIFY(statbuf.ohdr.nchunks, 9, "H5Gget_objinfo");
- VERIFY(statbuf.ohdr.size, 888, "H5Gget_objinfo");
- VERIFY(statbuf.ohdr.free, 16, "H5Gget_objinfo");
+ VERIFY(statbuf.u.obj.ohdr.nmesgs, 24, "H5Gget_objinfo");
+ VERIFY(statbuf.u.obj.ohdr.nchunks, 9, "H5Gget_objinfo");
+ VERIFY(statbuf.u.obj.ohdr.size, 888, "H5Gget_objinfo");
+ VERIFY(statbuf.u.obj.ohdr.free, 16, "H5Gget_objinfo");
/* Get object information for dataset #2 now */
ret = H5Gget_objinfo(fid,MISC18_DSET2_NAME,0,&statbuf);
CHECK(ret, FAIL, "H5Gget_objinfo");
- VERIFY(statbuf.ohdr.nmesgs, 24, "H5Gget_objinfo");
- VERIFY(statbuf.ohdr.nchunks, 9, "H5Gget_objinfo");
- VERIFY(statbuf.ohdr.size, 888, "H5Gget_objinfo");
- VERIFY(statbuf.ohdr.free, 16, "H5Gget_objinfo");
+ VERIFY(statbuf.u.obj.ohdr.nmesgs, 24, "H5Gget_objinfo");
+ VERIFY(statbuf.u.obj.ohdr.nchunks, 9, "H5Gget_objinfo");
+ VERIFY(statbuf.u.obj.ohdr.size, 888, "H5Gget_objinfo");
+ VERIFY(statbuf.u.obj.ohdr.free, 16, "H5Gget_objinfo");
/* Close second dataset */
ret = H5Dclose(did2);
diff --git a/test/unlink.c b/test/unlink.c
index c8b7ddc..76c9bcc 100644
--- a/test/unlink.c
+++ b/test/unlink.c
@@ -464,7 +464,7 @@ check_new_move(void)
puts(" Unexpected object type, should have been a group");
goto error;
}
- if( sb_hard1.objno!=sb_hard2.objno) {
+ if( sb_hard1.u.obj.objno!=sb_hard2.u.obj.objno) {
H5_FAILED();
puts(" Hard link test failed. Link seems not to point to the ");
puts(" expected file location.");