diff options
author | Robb Matzke <matzke@llnl.gov> | 1998-06-10 14:43:15 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1998-06-10 14:43:15 (GMT) |
commit | ac4c35cca592fc598c5a064fd8f769bbef69bd75 (patch) | |
tree | 6b23aa1ea8834532ca1de25b3fa469bc3d2a8158 /test | |
parent | 27edf86f6ab408352b4b975669d0759aa47bff78 (diff) | |
download | hdf5-ac4c35cca592fc598c5a064fd8f769bbef69bd75.zip hdf5-ac4c35cca592fc598c5a064fd8f769bbef69bd75.tar.gz hdf5-ac4c35cca592fc598c5a064fd8f769bbef69bd75.tar.bz2 |
[svn-r418] ./html/Files.html
./src/H5F.c
./src/HFcore.c
./src/H5Ffamily.c
./src/H5Flow.c
./src/H5Fmpio.c
./src/H5Fprivate.h
./src/H5Fsec2.c
./src/H5Fsplit.c
./src/H5Fstdio.c
./src/H5MF.c
./src/H5P.c
./src/H5Ppublic.h
Added H5Pset_alignment() so that it is now possible to align
file allocation requests on application-specified
boundaries. Any request >= the specified threshold will begin
on an address which is a multiple of the specified
alignment. Defaults are one for threshold and alignment. The
alignment is done on relative addresses, so the size of the
user block can affect the location of the data in the file.
./src/H5D.c
./src/dsets.c
Added a test for, and fixed the data space caching bug in
datasets. Extending a dataset through one handle will cause
all other handles to the same dataset to get the new dataset
size.
./src/H5S.c
./src/H5Sprivate.h
Removed an unused argument from H5S_read() which duplicated
information from the other argument.
./config/linux
Made `--enable-parallel' the default on my system. It used to
be that way before but then I accidently turned it off and
forgot about it.
./src/H5Fmpio.c
Qualified some function arguments with __unused__. Changed a
couple places where NULL was returned on error for herr_t
functions.
./src/H5P.c
Removed unused autos from H5Pset_mpi().
Diffstat (limited to 'test')
-rw-r--r-- | test/.distdep | 23 | ||||
-rw-r--r-- | test/dsets.c | 74 |
2 files changed, 87 insertions, 10 deletions
diff --git a/test/.distdep b/test/.distdep index 349d760..991f255 100644 --- a/test/.distdep +++ b/test/.distdep @@ -41,8 +41,8 @@ tfile.o: \ ../src/H5Bpublic.h \ ../src/H5Fprivate.h \ ../src/H5Fpublic.h \ - ../src/H5Pprivate.h \ - ../src/H5Ppublic.h + ../src/H5Dpublic.h \ + ../src/H5Pprivate.h theap.o: \ theap.c \ testhdf5.h \ @@ -57,9 +57,9 @@ theap.o: \ ../src/H5ACpublic.h \ ../src/H5Fprivate.h \ ../src/H5Fpublic.h \ + ../src/H5Dpublic.h \ ../src/H5Pprivate.h \ ../src/H5Ppublic.h \ - ../src/H5Dpublic.h \ ../src/H5Zpublic.h tmeta.o: \ tmeta.c \ @@ -84,9 +84,9 @@ tohdr.o: \ ../src/H5ACpublic.h \ ../src/H5Fprivate.h \ ../src/H5Fpublic.h \ + ../src/H5Dpublic.h \ ../src/H5Pprivate.h \ ../src/H5Ppublic.h \ - ../src/H5Dpublic.h \ ../src/H5Zpublic.h \ ../src/H5Gprivate.h \ ../src/H5Gpublic.h \ @@ -114,9 +114,9 @@ tstab.o: \ ../src/H5ACpublic.h \ ../src/H5Fprivate.h \ ../src/H5Fpublic.h \ + ../src/H5Dpublic.h \ ../src/H5Pprivate.h \ ../src/H5Ppublic.h \ - ../src/H5Dpublic.h \ ../src/H5Zpublic.h \ ../src/H5Gprivate.h \ ../src/H5Gpublic.h \ @@ -143,6 +143,7 @@ th5s.o: \ ../src/H5Bpublic.h \ ../src/H5Fprivate.h \ ../src/H5Fpublic.h \ + ../src/H5Dpublic.h \ ../src/H5Sprivate.h \ ../src/H5Spublic.h \ ../src/H5Gprivate.h \ @@ -155,8 +156,7 @@ th5s.o: \ ../src/H5Tpublic.h \ ../src/H5Zprivate.h \ ../src/H5Zpublic.h \ - ../src/H5Pprivate.h \ - ../src/H5Ppublic.h + ../src/H5Pprivate.h dtypes.o: \ dtypes.c \ ../src/hdf5.h \ @@ -328,13 +328,13 @@ gheap.o: \ ../src/H5Ipublic.h \ ../src/H5Fprivate.h \ ../src/H5Fpublic.h \ + ../src/H5Dpublic.h \ ../src/H5Gprivate.h \ ../src/H5Gpublic.h \ ../src/H5Bprivate.h \ ../src/H5Bpublic.h \ ../src/H5HGprivate.h \ - ../src/H5HGpublic.h \ - ../src/H5Pprivate.h + ../src/H5HGpublic.h shtype.o: \ shtype.c \ ../src/hdf5.h \ @@ -397,7 +397,10 @@ links.o: \ ../src/H5MFpublic.h \ ../src/H5MMpublic.h \ ../src/H5Opublic.h \ - ../src/H5Ppublic.h + ../src/H5Ppublic.h \ + ../src/H5Zpublic.h \ + ../src/H5Spublic.h \ + ../src/H5Tpublic.h chunk.o: \ chunk.c \ ../src/hdf5.h \ diff --git a/test/dsets.c b/test/dsets.c index fac3bdb..576a575 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -670,6 +670,77 @@ test_compression(hid_t file) error: return -1; } + + +/*------------------------------------------------------------------------- + * Function: test_multiopen + * + * Purpose: Tests that a bug no longer exists. If a dataset is opened + * twice and one of the handles is used to extend the dataset, + * then the other handle should return the new size when + * queried. + * + * Return: Success: 0 + * + * Failure: -1 + * + * Programmer: Robb Matzke + * Tuesday, June 9, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static herr_t +test_multiopen (hid_t file) +{ + hid_t dcpl, space, dset1, dset2; + hsize_t cur_size[1] = {10}; + static hsize_t max_size[1] = {H5S_UNLIMITED}; + hsize_t tmp_size[1]; + + printf ("%-70s", "Testing multi-open with extending"); + + /* Create the dataset and open it twice */ + if ((dcpl=H5Pcreate (H5P_DATASET_CREATE))<0) goto error; + if (H5Pset_chunk (dcpl, 1, cur_size)<0) goto error; + if ((space=H5Screate_simple (1, cur_size, max_size))<0) goto error; + if ((dset1=H5Dcreate (file, "multiopen", H5T_NATIVE_INT, space, + dcpl))<0) goto error; + if ((dset2=H5Dopen (file, "multiopen"))<0) goto error; + if (H5Sclose (space)<0) goto error; + + /* Extend with the first handle */ + cur_size[0] = 20; + if (H5Dextend (dset1, cur_size)<0) goto error; + + /* Get the size from the second handle */ + if ((space = H5Dget_space (dset2))<0) goto error; + if (H5Sget_dims (space, tmp_size)<0) goto error; + if (cur_size[0]!=tmp_size[0]) { + puts ("*FAILED*"); + printf (" Got %d instead of %d!\n", + (int)tmp_size[0], (int)cur_size[0]); + goto error; + } + + if (H5Dclose (dset1)<0) goto error; + if (H5Dclose (dset2)<0) goto error; + if (H5Sclose (space)<0) goto error; + if (H5Pclose (dcpl)<0) goto error; + puts (" PASSED"); + return 0; + + error: + H5E_BEGIN_TRY { + H5Dclose (dset1); + H5Dclose (dset2); + H5Sclose (space); + H5Pclose (dcpl); + } H5E_END_TRY; + return -1; +} + /*------------------------------------------------------------------------- * Function: cleanup @@ -744,6 +815,9 @@ main(void) status = test_compression(file); nerrors += status < 0 ? 1 : 0; + status = test_multiopen (file); + nerrors += status < 0 ? 1 : 0; + status = H5Fclose(file); if (nerrors) { |