2004-07-15 04:18:28 +08:00
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
2007-02-07 22:56:24 +08:00
|
|
|
* Copyright by The HDF Group. *
|
2004-07-15 04:18:28 +08:00
|
|
|
* Copyright by the Board of Trustees of the University of Illinois. *
|
|
|
|
* All rights reserved. *
|
|
|
|
* *
|
|
|
|
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
|
|
|
* terms governing use, modification, and redistribution, is contained in *
|
|
|
|
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
|
|
|
* of the source code distribution tree; Copyright.html can be found at the *
|
|
|
|
* root level of an installed copy of the electronic HDF5 document set and *
|
|
|
|
* is linked from the top-level documents page. It can also be found at *
|
2007-02-07 22:56:24 +08:00
|
|
|
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
|
|
|
* access to either file, you may request a copy from help@hdfgroup.org. *
|
2004-07-15 04:18:28 +08:00
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
|
|
|
|
#include "h5test.h"
|
|
|
|
|
2006-10-09 12:18:18 +08:00
|
|
|
#ifdef BROKEN
|
2004-07-23 00:26:54 +08:00
|
|
|
const char *FILENAME[] = {
|
|
|
|
"rsrv_heap",
|
|
|
|
"rsrv_ohdr",
|
|
|
|
"rsrv_vlen",
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
2004-07-15 04:18:28 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: rsrv_heap
|
|
|
|
*
|
|
|
|
* Purpose: Ensure that heaps reserve file address space.
|
|
|
|
* This function does this by creating datasets up to and past
|
|
|
|
* the limit of the file, then ensuring that an error (not an
|
|
|
|
* assert) was generated and that the file is readable.
|
|
|
|
*
|
|
|
|
* Return: Success: 0
|
|
|
|
* Failure: 1
|
|
|
|
*
|
|
|
|
* Programmer: James Laird
|
2004-07-23 00:26:54 +08:00
|
|
|
* Nat Furrer
|
2004-07-15 04:18:28 +08:00
|
|
|
* Friday, May 28, 2004
|
|
|
|
*
|
|
|
|
* Modifications:
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2004-07-17 04:48:40 +08:00
|
|
|
static herr_t
|
|
|
|
rsrv_heap(void)
|
2004-07-15 04:18:28 +08:00
|
|
|
{
|
2004-12-29 22:26:20 +08:00
|
|
|
hid_t file_id=(-1), dataset_id=(-1), dataspace_id=(-1);
|
|
|
|
hid_t fapl=(-1), fcpl=(-1);
|
2004-07-17 04:48:40 +08:00
|
|
|
hsize_t dims[1] = {1};
|
2004-07-23 00:26:54 +08:00
|
|
|
char filename[1024], dset_name[10];
|
|
|
|
int i;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
|
|
|
TESTING("Reserving file space for heap");
|
|
|
|
|
2004-07-17 04:48:40 +08:00
|
|
|
/* Create a new file. */
|
2004-07-23 00:26:54 +08:00
|
|
|
fapl = h5_fileaccess();
|
2006-10-11 04:07:16 +08:00
|
|
|
|
2004-07-23 00:26:54 +08:00
|
|
|
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
|
2004-07-17 04:48:40 +08:00
|
|
|
/* Set file address sizes to be very small. */
|
2004-07-23 00:26:54 +08:00
|
|
|
fcpl = H5Pcreate(H5P_FILE_CREATE);
|
|
|
|
if(fcpl < 0) TEST_ERROR;
|
|
|
|
if(H5Pset_sizes(fcpl, (size_t)2,(size_t)2) < 0) TEST_ERROR;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
2004-07-23 00:26:54 +08:00
|
|
|
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl);
|
|
|
|
if(file_id < 0) TEST_ERROR;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
2004-07-17 04:48:40 +08:00
|
|
|
/* Write datasets until the file is full, at which point HDF5
|
|
|
|
* should throw an error.
|
|
|
|
*/
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
for(i = 0; i < 200; i++) {
|
2004-07-17 04:48:40 +08:00
|
|
|
H5E_BEGIN_TRY {
|
|
|
|
dataspace_id = H5Screate_simple(1, dims, dims);
|
|
|
|
} H5E_END_TRY
|
2004-07-15 04:18:28 +08:00
|
|
|
|
2004-07-17 04:48:40 +08:00
|
|
|
sprintf(dset_name, "Dset %d", i);
|
2004-07-15 04:18:28 +08:00
|
|
|
|
2004-07-17 04:48:40 +08:00
|
|
|
H5E_BEGIN_TRY {
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
dataset_id = H5Dcreate2(file_id, dset_name, H5T_NATIVE_INT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
2004-07-17 04:48:40 +08:00
|
|
|
} H5E_END_TRY
|
2004-07-15 04:18:28 +08:00
|
|
|
|
2004-07-17 04:48:40 +08:00
|
|
|
if(dataset_id < 0)
|
|
|
|
break;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
2004-07-17 04:48:40 +08:00
|
|
|
H5E_BEGIN_TRY {
|
|
|
|
H5Dwrite(dataset_id, H5T_NATIVE_INT, dataspace_id, dataspace_id, H5P_DEFAULT, &i);
|
|
|
|
} H5E_END_TRY
|
2004-07-15 04:18:28 +08:00
|
|
|
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
if(H5Dclose(dataset_id) < 0) TEST_ERROR;
|
|
|
|
if(H5Sclose(dataspace_id) < 0) TEST_ERROR;
|
|
|
|
} /* end for */
|
2004-07-15 04:18:28 +08:00
|
|
|
|
2004-07-17 04:48:40 +08:00
|
|
|
/* The loop should have broken before completing--the file should not have had
|
|
|
|
* enough address space to hold 200 datasets (or this test needs to be updated!).
|
|
|
|
*/
|
|
|
|
if(i == 200)
|
2004-07-23 00:26:54 +08:00
|
|
|
TEST_ERROR;
|
|
|
|
|
|
|
|
/* Close the file, property lists, and library */
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
if(H5Fclose(file_id) < 0) TEST_ERROR;
|
|
|
|
if(H5Pclose(fapl) < 0) TEST_ERROR;
|
|
|
|
if(H5Pclose(fcpl) < 0) TEST_ERROR;
|
|
|
|
if(H5close() < 0) TEST_ERROR;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
2004-07-17 04:48:40 +08:00
|
|
|
/* Re-open the library and try to read a dataset from the file we created */
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
if(H5open() < 0) TEST_ERROR;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
2004-07-17 04:48:40 +08:00
|
|
|
sprintf(dset_name, "Dset %d", i - 2);
|
2004-07-15 04:18:28 +08:00
|
|
|
|
2004-07-23 00:26:54 +08:00
|
|
|
file_id = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT);
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
if(file_id < 0) TEST_ERROR;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
dataset_id = H5Dopen2(file_id, dset_name, H5P_DEFAULT);
|
2004-07-15 04:18:28 +08:00
|
|
|
|
2004-07-17 04:48:40 +08:00
|
|
|
/* If we can read a dataset from the file, the file has been flushed to disk
|
|
|
|
* (if the heap or object headers weren't flushed, the file would be empty).
|
|
|
|
*/
|
|
|
|
if(dataset_id == H5I_BADID)
|
2004-07-23 00:26:54 +08:00
|
|
|
TEST_ERROR;
|
|
|
|
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
if(H5Dclose(dataset_id) < 0) TEST_ERROR;
|
|
|
|
if(H5Fclose(file_id) < 0) TEST_ERROR;
|
2004-07-23 00:26:54 +08:00
|
|
|
|
|
|
|
PASSED();
|
|
|
|
return 0;
|
|
|
|
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
error:
|
|
|
|
/* Close everything we can and exit */
|
|
|
|
H5E_BEGIN_TRY {
|
2004-07-23 00:26:54 +08:00
|
|
|
H5Dclose(dataset_id);
|
|
|
|
H5Sclose(dataspace_id);
|
|
|
|
H5Pclose(fcpl);
|
|
|
|
H5Pclose(fapl);
|
|
|
|
H5Fclose(file_id);
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
} H5E_END_TRY
|
|
|
|
return 1;
|
2004-07-15 04:18:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: rsrv_ohdr
|
|
|
|
*
|
|
|
|
* Purpose: Ensure that object headers reserve file address space.
|
|
|
|
* This function does this by creating attributes of a dataset
|
|
|
|
* past the limit of the file, then ensuring that an error (not
|
|
|
|
* an assert) was generated and that the file is readable.
|
|
|
|
*
|
|
|
|
* Return: Success: 0
|
|
|
|
* Failure: 1
|
|
|
|
*
|
|
|
|
* Programmer: James Laird
|
2004-07-23 00:26:54 +08:00
|
|
|
* Nat Furrer
|
2004-07-15 04:18:28 +08:00
|
|
|
* Friday, May 28, 2004
|
|
|
|
*
|
|
|
|
* Modifications:
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2004-07-17 04:48:40 +08:00
|
|
|
static herr_t
|
|
|
|
rsrv_ohdr(void)
|
2004-07-15 04:18:28 +08:00
|
|
|
{
|
2004-12-29 22:26:20 +08:00
|
|
|
hid_t file_id=(-1), dataset_id=(-1), dataspace_id=(-1);
|
|
|
|
hid_t fapl=(-1), fcpl=(-1), aid, attr_id;
|
2004-07-17 04:48:40 +08:00
|
|
|
hsize_t dims[2];
|
2004-07-23 00:26:54 +08:00
|
|
|
herr_t status;
|
2004-07-17 04:48:40 +08:00
|
|
|
int attrval[4][6];
|
2004-07-23 00:26:54 +08:00
|
|
|
char filename[1024], attrname[20];
|
|
|
|
int i;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
|
|
|
TESTING("Reserving file space for object headers");
|
|
|
|
|
2004-07-23 00:26:54 +08:00
|
|
|
/* Create a new file */
|
|
|
|
fapl = h5_fileaccess();
|
|
|
|
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
|
|
|
|
|
|
|
|
fcpl = H5Pcreate(H5P_FILE_CREATE);
|
|
|
|
if(fcpl < 0) TEST_ERROR;
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
if(H5Pset_sizes(fcpl, (size_t)2,(size_t)2) < 0) TEST_ERROR;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
2004-07-23 00:26:54 +08:00
|
|
|
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl);
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
if(file_id < 0) TEST_ERROR;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
2004-07-17 04:48:40 +08:00
|
|
|
/* Create the data space for the dataset. */
|
2005-08-14 04:53:35 +08:00
|
|
|
dims[0] = 4;
|
|
|
|
dims[1] = 6;
|
2004-07-17 04:48:40 +08:00
|
|
|
dataspace_id = H5Screate_simple(2, dims, NULL);
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
if(dataspace_id < 0) TEST_ERROR;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
2004-07-17 04:48:40 +08:00
|
|
|
/* Create the dataset. */
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
dataset_id = H5Dcreate2(file_id, "/dset", H5T_STD_I32BE, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
|
|
|
if(dataset_id < 0) TEST_ERROR;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
for(i = 0; i < 6; i++) {
|
2004-07-15 04:18:28 +08:00
|
|
|
attrval[0][i] = 0;
|
|
|
|
attrval[1][i] = 1;
|
|
|
|
attrval[2][i] = 2;
|
|
|
|
attrval[3][i] = 3;
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
} /* end for */
|
2004-07-15 04:18:28 +08:00
|
|
|
|
[svn-r14187] Description:
Put H5Acreate() under API versioning, with all internal usage shifted
to H5Acreate2().
Add regression tests for H5Acreate1().
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-05 06:19:07 +08:00
|
|
|
for(i = 0; i < 2000; i++) {
|
2004-07-17 04:48:40 +08:00
|
|
|
sprintf(attrname, "attr %d", i);
|
|
|
|
H5E_BEGIN_TRY{
|
|
|
|
aid = H5Screate_simple(2, dims, NULL);
|
[svn-r14218] Description:
Changed H5Acreate2 -> H5Acreate_by_name, to be more consistent with
other new API routines.
Re-added simpler form of H5Acreate2, which creates attributes directly
on an object.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 02:13:48 +08:00
|
|
|
attr_id = H5Acreate2(dataset_id, attrname, H5T_STD_I32BE, aid, H5P_DEFAULT, H5P_DEFAULT);
|
2004-07-23 00:26:54 +08:00
|
|
|
H5Awrite(attr_id, H5T_NATIVE_INT, attrval);
|
2004-07-17 04:48:40 +08:00
|
|
|
status = H5Aclose(attr_id);
|
|
|
|
} H5E_END_TRY
|
2004-07-15 04:18:28 +08:00
|
|
|
|
|
|
|
if(status < 0)
|
|
|
|
break;
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
} /* end for */
|
2004-07-15 04:18:28 +08:00
|
|
|
|
2004-07-17 04:48:40 +08:00
|
|
|
/* The loop should have broken before completing--the file should not have had
|
2004-07-23 00:26:54 +08:00
|
|
|
* enough address space to hold 2000 attributes (or this test needs to be updated
|
|
|
|
!).
|
2004-07-17 04:48:40 +08:00
|
|
|
*/
|
2004-07-15 04:18:28 +08:00
|
|
|
if(i == 2000)
|
2004-07-23 00:26:54 +08:00
|
|
|
TEST_ERROR;
|
|
|
|
|
|
|
|
/* End access to the dataset and dataspace and release resources. */
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
if(H5Dclose(dataset_id) < 0) TEST_ERROR;
|
|
|
|
if(H5Pclose(fapl) < 0) TEST_ERROR;
|
|
|
|
if(H5Pclose(fcpl) < 0) TEST_ERROR;
|
|
|
|
if(H5Sclose(dataspace_id) < 0) TEST_ERROR;
|
2004-07-23 00:26:54 +08:00
|
|
|
|
|
|
|
/* Close the file and the library. */
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
if(H5Fclose(file_id) < 0) TEST_ERROR;
|
|
|
|
if(H5close() < 0) TEST_ERROR;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
2004-07-17 04:48:40 +08:00
|
|
|
/* Re-open the library and try to read a dataset from the file we created */
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
if(H5open() < 0) TEST_ERROR;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
2004-07-23 00:26:54 +08:00
|
|
|
file_id = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT);
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
if(file_id < 0) TEST_ERROR;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
dataset_id = H5Dopen2(file_id, "/dset", H5P_DEFAULT);
|
2004-07-15 04:18:28 +08:00
|
|
|
|
2004-07-17 04:48:40 +08:00
|
|
|
/* If we can read the dataset from the file, the file has been flushed to disk
|
|
|
|
* (if the heap or object headers weren't flushed, the file would be empty).
|
|
|
|
*/
|
|
|
|
if(dataset_id == H5I_BADID)
|
2004-07-23 00:26:54 +08:00
|
|
|
TEST_ERROR;
|
|
|
|
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
if(H5Dclose(dataset_id) < 0) TEST_ERROR;
|
|
|
|
if(H5Fclose(file_id) < 0) TEST_ERROR;
|
2004-07-23 00:26:54 +08:00
|
|
|
|
|
|
|
PASSED();
|
|
|
|
return 0;
|
|
|
|
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
error:
|
|
|
|
/* Close everything we can and exit */
|
|
|
|
H5E_BEGIN_TRY {
|
2004-07-23 00:26:54 +08:00
|
|
|
H5Dclose(dataset_id);
|
|
|
|
H5Sclose(dataspace_id);
|
|
|
|
H5Pclose(fcpl);
|
|
|
|
H5Pclose(fapl);
|
|
|
|
H5Fclose(file_id);
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
} H5E_END_TRY
|
|
|
|
return 1;
|
2004-07-15 04:18:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: rsrv_vlen
|
|
|
|
*
|
|
|
|
* Purpose: Ensure that variable length datatypes properly ensure that
|
|
|
|
* enough file address space exists before writing.
|
|
|
|
* This function does this by creating a dataset containing
|
|
|
|
* variable length data past the limit of the file, then
|
2005-08-14 04:53:35 +08:00
|
|
|
* ensuring that an error (not an assert) was generated and
|
2004-07-15 04:18:28 +08:00
|
|
|
* that the file is readable.
|
|
|
|
*
|
|
|
|
* Return: Success: 0
|
|
|
|
* Failure: 1
|
|
|
|
*
|
|
|
|
* Programmer: James Laird
|
|
|
|
* Nat Furrer
|
|
|
|
* Thursday, July 1, 2004
|
|
|
|
*
|
|
|
|
* Modifications:
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
2004-07-17 04:48:40 +08:00
|
|
|
static herr_t
|
|
|
|
rsrv_vlen(void)
|
2004-07-15 04:18:28 +08:00
|
|
|
{
|
2004-12-29 22:26:20 +08:00
|
|
|
hid_t file_id=(-1), dataset_id=(-1), dataspace_id=(-1), type_id=(-1);
|
|
|
|
hid_t fapl=(-1), fcpl=(-1), mem_space_id=(-1);
|
2004-07-17 04:48:40 +08:00
|
|
|
hssize_t offset[1];
|
2004-12-29 22:26:20 +08:00
|
|
|
hsize_t start[1];
|
2004-07-17 04:48:40 +08:00
|
|
|
hsize_t dims[1], count[1];
|
2004-07-23 00:26:54 +08:00
|
|
|
herr_t status;
|
|
|
|
int i;
|
|
|
|
int write_buf[20];
|
|
|
|
char filename[1024];
|
|
|
|
hvl_t vlen_data;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
|
|
|
TESTING("Reserved space with variable length data");
|
|
|
|
|
2004-07-23 00:26:54 +08:00
|
|
|
/* Create a new file */
|
|
|
|
fapl = h5_fileaccess();
|
|
|
|
h5_fixname(FILENAME[2], fapl, filename, sizeof filename);
|
|
|
|
|
|
|
|
/* Make file address space very small */
|
|
|
|
fcpl = H5Pcreate(H5P_FILE_CREATE);
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
if(fcpl < 0) TEST_ERROR;
|
|
|
|
if(H5Pset_sizes(fcpl, (size_t)2,(size_t)2) < 0) TEST_ERROR;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
2004-07-23 00:26:54 +08:00
|
|
|
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl);
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
if(file_id < 0) TEST_ERROR;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
|
|
|
/* Create the data space for the dataset. */
|
2005-08-14 04:53:35 +08:00
|
|
|
dims[0] = 2000;
|
2004-07-15 04:18:28 +08:00
|
|
|
dataspace_id = H5Screate_simple(1, dims, NULL);
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
if(dataspace_id < 0) TEST_ERROR;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
|
|
|
/* Create a variable length type */
|
|
|
|
type_id = H5Tvlen_create(H5T_NATIVE_INT);
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
if(type_id < 0) TEST_ERROR;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
|
|
|
/* Create the dataset. */
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
dataset_id = H5Dcreate2(file_id, "/dset", type_id, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
|
|
|
if(dataset_id < 0) TEST_ERROR;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
|
|
|
/* Create some data to write */
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
for(i = 0; i < 20; i++)
|
|
|
|
write_buf[i] = i + 1;
|
2004-07-15 04:18:28 +08:00
|
|
|
vlen_data.p = write_buf;
|
|
|
|
|
|
|
|
/* Create a memory dataspace for writing */
|
|
|
|
dims[0] = 1;
|
2005-08-14 04:53:35 +08:00
|
|
|
mem_space_id = H5Screate_simple(1, dims, NULL);
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
if(mem_space_id < 0) TEST_ERROR;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
|
|
|
/* Create a selection to write to */
|
|
|
|
start[0] = 0;
|
|
|
|
count[0] = 1;
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
if(H5Sselect_hyperslab(dataspace_id, H5S_SELECT_SET, start, NULL, count, NULL) < 0) TEST_ERROR;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
for(i = 0; i< 2000; i++) {
|
2004-07-15 04:18:28 +08:00
|
|
|
vlen_data.len = (i%20) + 1;
|
|
|
|
|
2004-07-17 04:48:40 +08:00
|
|
|
offset[0] = i;
|
2005-08-14 04:53:35 +08:00
|
|
|
if( H5Soffset_simple(dataspace_id, offset) <0) TEST_ERROR;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
|
|
|
H5E_BEGIN_TRY
|
2004-07-17 04:48:40 +08:00
|
|
|
status = H5Dwrite(dataset_id, type_id, mem_space_id, dataspace_id, H5P_DEFAULT, &vlen_data);
|
2004-07-15 04:18:28 +08:00
|
|
|
H5E_END_TRY
|
|
|
|
|
|
|
|
if(status < 0)
|
|
|
|
break;
|
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
|
|
|
} /* end for */
|
2004-07-15 04:18:28 +08:00
|
|
|
|
|
|
|
/* The loop should have broken before completing--the file should not have had
|
|
|
|
* enough address space to hold 2000 attributes (or this test needs to be updated!).
|
|
|
|
*/
|
|
|
|
if(i == 2000)
|
2004-07-23 00:26:54 +08:00
|
|
|
TEST_ERROR;
|
|
|
|
|
|
|
|
/* End access to the dataset and dataspace and release resources. */
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
if(H5Dclose(dataset_id) < 0) TEST_ERROR;
|
|
|
|
if(H5Pclose(fcpl) < 0) TEST_ERROR;
|
|
|
|
if(H5Pclose(fapl) < 0) TEST_ERROR;
|
|
|
|
if(H5Sclose(dataspace_id) < 0) TEST_ERROR;
|
|
|
|
if(H5Tclose(type_id) < 0) TEST_ERROR;
|
|
|
|
if(H5Sclose(mem_space_id) < 0) TEST_ERROR;
|
2004-07-23 00:26:54 +08:00
|
|
|
|
|
|
|
/* Close the file and the library. */
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
if(H5Fclose(file_id) < 0) TEST_ERROR;
|
|
|
|
if(H5close() < 0) TEST_ERROR;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
|
|
|
/* Re-open the library and try to read a dataset from the file we created */
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
if(H5open() < 0) TEST_ERROR;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
2004-07-23 00:26:54 +08:00
|
|
|
file_id = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT);
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
if(file_id < 0) TEST_ERROR;
|
2004-07-15 04:18:28 +08:00
|
|
|
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
dataset_id = H5Dopen2(file_id, "/dset", H5P_DEFAULT);
|
2004-07-15 04:18:28 +08:00
|
|
|
|
|
|
|
/* If we can read the dataset from the file, the file has been flushed to disk
|
|
|
|
* (if the heap or object headers weren't flushed, the file would be empty).
|
|
|
|
*/
|
|
|
|
if(dataset_id == H5I_BADID)
|
2004-07-23 00:26:54 +08:00
|
|
|
TEST_ERROR;
|
|
|
|
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
if(H5Dclose(dataset_id) < 0) TEST_ERROR;
|
|
|
|
if(H5Fclose(file_id) < 0) TEST_ERROR;
|
2004-07-23 00:26:54 +08:00
|
|
|
|
|
|
|
PASSED();
|
|
|
|
return 0;
|
|
|
|
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
error:
|
|
|
|
/* Close everything we can and exit */
|
|
|
|
H5E_BEGIN_TRY {
|
2004-07-23 00:26:54 +08:00
|
|
|
H5Dclose(dataset_id);
|
|
|
|
H5Sclose(dataspace_id);
|
|
|
|
H5Sclose(mem_space_id);
|
|
|
|
H5Tclose(type_id);
|
|
|
|
H5Pclose(fcpl);
|
|
|
|
H5Pclose(fapl);
|
|
|
|
H5Fclose(file_id);
|
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
|
|
|
} H5E_END_TRY
|
|
|
|
return 1;
|
2004-07-15 04:18:28 +08:00
|
|
|
}
|
2006-10-09 12:18:18 +08:00
|
|
|
#endif /* BROKEN */
|
2004-07-15 04:18:28 +08:00
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: main
|
|
|
|
*
|
2005-08-14 04:53:35 +08:00
|
|
|
* Purpose:
|
2004-07-15 04:18:28 +08:00
|
|
|
*
|
2005-08-14 04:53:35 +08:00
|
|
|
* Return: Success:
|
2004-07-15 04:18:28 +08:00
|
|
|
*
|
2005-08-14 04:53:35 +08:00
|
|
|
* Failure:
|
2004-07-15 04:18:28 +08:00
|
|
|
*
|
|
|
|
* Programmer: Nat Furrer and James Laird
|
|
|
|
* Thursday, July 1, 2004
|
|
|
|
*
|
|
|
|
* Modifications:
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
main(void)
|
|
|
|
{
|
2006-10-07 01:38:42 +08:00
|
|
|
/* This test is currently not working properly; it should be revisted
|
|
|
|
* when we have time.
|
[svn-r15868] Description:
Correct a minor error in file free space allocation which was affecting
the 'multi' VFD and preventing some tests from fully working with it.
Wholesale revisitation of all the places where tests were disabled
with various VFDs and remove or correct all these so that _only_ the tests
which _really_ can't work with particular VFDs are skipped during a
'make check-vfd' test.
Tested on:
Mac OS X/32 10.5.5 (amazon) in debug mode
Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
2008-10-15 09:46:34 +08:00
|
|
|
*
|
|
|
|
* (Also, we should try to make this test work with all the VFDs)
|
2006-10-07 01:38:42 +08:00
|
|
|
*/
|
|
|
|
#ifdef BROKEN
|
2006-10-09 12:18:18 +08:00
|
|
|
int num_errs=0;
|
|
|
|
hid_t fapl;
|
|
|
|
const char *envval = NULL;
|
|
|
|
|
2006-08-01 03:46:16 +08:00
|
|
|
envval = HDgetenv("HDF5_DRIVER");
|
2008-09-16 23:52:51 +08:00
|
|
|
if (envval == NULL)
|
2006-08-01 03:46:16 +08:00
|
|
|
envval = "nomatch";
|
2007-06-16 03:11:59 +08:00
|
|
|
/* QAK: should be able to use the core driver? */
|
2006-08-01 03:46:16 +08:00
|
|
|
if (HDstrcmp(envval, "core") && HDstrcmp(envval, "split") && HDstrcmp(envval, "multi") && HDstrcmp(envval, "family")) {
|
|
|
|
num_errs+=rsrv_ohdr();
|
|
|
|
num_errs+=rsrv_heap();
|
|
|
|
num_errs+=rsrv_vlen();
|
|
|
|
|
|
|
|
if(num_errs > 0)
|
|
|
|
printf("**** %d FAILURE%s! ****\n", num_errs, num_errs==1?"":"S");
|
|
|
|
else
|
|
|
|
puts("All address space reservation tests passed.");
|
|
|
|
|
|
|
|
fapl = h5_fileaccess();
|
|
|
|
h5_cleanup(FILENAME, fapl);
|
|
|
|
return num_errs;
|
|
|
|
}
|
2004-07-23 00:26:54 +08:00
|
|
|
else
|
2006-08-01 03:46:16 +08:00
|
|
|
{
|
|
|
|
puts("All address space reservation tests skippped - Incompatible with current Virtual File Driver");
|
|
|
|
}
|
2006-10-09 12:18:18 +08:00
|
|
|
#endif /* BROKEN */
|
2006-10-07 01:38:42 +08:00
|
|
|
|
|
|
|
SKIPPED();
|
2006-08-01 03:46:16 +08:00
|
|
|
return 0;
|
2004-07-23 00:26:54 +08:00
|
|
|
|
2004-07-15 04:18:28 +08:00
|
|
|
}
|
|
|
|
|