summaryrefslogtreecommitdiffstats
path: root/test/dsets.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2002-11-07 15:57:53 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2002-11-07 15:57:53 (GMT)
commit2c78145f74f5aab70fdd3f81106fca6a0dfc4b16 (patch)
tree2ac2928cd285fb09c688ce95dac062bbb90e16ae /test/dsets.c
parenta9dea215ed696c1523fec79b4175b571600dca77 (diff)
downloadhdf5-2c78145f74f5aab70fdd3f81106fca6a0dfc4b16.zip
hdf5-2c78145f74f5aab70fdd3f81106fca6a0dfc4b16.tar.gz
hdf5-2c78145f74f5aab70fdd3f81106fca6a0dfc4b16.tar.bz2
[svn-r6062]
Purpose: New function. Description: H5Dget_offset returns the offset of a dataset's data relative to the beginning of a file. Platforms tested: arabica(simple function, one test should be enough.) Misc. update: RELEASE.txt
Diffstat (limited to 'test/dsets.c')
-rw-r--r--test/dsets.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/dsets.c b/test/dsets.c
index 11bad7f..3de7af3 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -155,6 +155,9 @@ test_create(hid_t file)
if (dataset < 0) goto error;
H5Pclose (create_parms);
+ /* Test dataset address. Should be undefined. */
+ if(H5Dget_offset(dataset)!=HADDR_UNDEF) goto error;
+
/*
* Close the chunked dataset.
*/
@@ -234,10 +237,16 @@ test_simple_io(hid_t file)
if ((dataset = H5Dcreate(file, DSET_SIMPLE_IO_NAME, H5T_NATIVE_INT, space,
H5P_DEFAULT))<0) goto error;
+ /* Test dataset address. Should be undefined. */
+ if(H5Dget_offset(dataset)!=HADDR_UNDEF) goto error;
+
/* Write the data to the dataset */
if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, points)<0)
goto error;
+ /* Test dataset address. Should be valid. */
+ if(H5Dget_offset(dataset)==HADDR_UNDEF) goto error;
+
/* Read the dataset back */
if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, check)<0)
goto error;
@@ -327,9 +336,16 @@ test_compact_io(hid_t fapl)
if((dataset = H5Dcreate(file, DSET_COMPACT_IO_NAME, H5T_NATIVE_INT, space,
plist))<0)
goto error;
+
+ /* Test dataset address. Should be undefined. */
+ if(H5Dget_offset(dataset)!=HADDR_UNDEF) goto error;
+
if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf)<0)
goto error;
+ /* Test dataset address. Should be undefined. */
+ if(H5Dget_offset(dataset)!=HADDR_UNDEF) goto error;
+
/* Close file */
H5Sclose(space);
H5Pclose(plist);