2003-04-01 01:59:04 +08:00
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
2007-02-07 22:56:24 +08:00
|
|
|
* Copyright by The HDF Group. *
|
2003-04-01 01:59:04 +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 *
|
2017-04-18 03:32:16 +08:00
|
|
|
* the COPYING file, which can be found at the root of the source code *
|
2021-02-17 22:52:04 +08:00
|
|
|
* distribution tree, or in https://www.hdfgroup.org/licenses. *
|
2017-04-18 03:32:16 +08:00
|
|
|
* If you do not have access to either file, you may request a copy from *
|
|
|
|
* help@hdfgroup.org. *
|
2003-04-01 01:59:04 +08:00
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
1999-09-29 08:30:47 +08:00
|
|
|
|
|
|
|
/***********************************************************
|
2020-09-30 22:27:10 +08:00
|
|
|
*
|
|
|
|
* Test program: tvlstr
|
|
|
|
*
|
|
|
|
* Test the Variable-Length String functionality
|
|
|
|
*
|
|
|
|
*************************************************************/
|
1999-09-29 08:30:47 +08:00
|
|
|
|
2001-04-04 02:09:16 +08:00
|
|
|
#include "testhdf5.h"
|
1999-09-29 08:30:47 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
#define DATAFILE "tvlstr.h5"
|
|
|
|
#define DATAFILE2 "tvlstr2.h5"
|
|
|
|
#define DATAFILE3 "sel2el.h5"
|
2018-12-06 06:48:47 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
#define DATASET "1Darray"
|
1999-09-29 08:30:47 +08:00
|
|
|
|
|
|
|
/* 1-D dataset with fixed dimensions */
|
2020-09-30 22:27:10 +08:00
|
|
|
#define SPACE1_RANK 1
|
|
|
|
#define SPACE1_DIM1 4
|
|
|
|
#define NUMP 4
|
1999-09-29 08:30:47 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
#define VLSTR_TYPE "vl_string_type"
|
2002-03-30 07:46:56 +08:00
|
|
|
|
2004-01-14 02:00:59 +08:00
|
|
|
/* Definitions for the VL re-writing test */
|
2020-09-30 22:27:10 +08:00
|
|
|
#define REWRITE_NDATASETS 32
|
2004-01-14 02:00:59 +08:00
|
|
|
|
2002-01-04 10:42:49 +08:00
|
|
|
/* String for testing attributes */
|
2020-09-30 22:27:10 +08:00
|
|
|
static const char *string_att = "This is the string for the attribute";
|
|
|
|
static char * string_att_write = NULL;
|
2002-01-04 10:42:49 +08:00
|
|
|
|
1999-09-29 08:30:47 +08:00
|
|
|
void *test_vlstr_alloc_custom(size_t size, void *info);
|
2020-09-30 22:27:10 +08:00
|
|
|
void test_vlstr_free_custom(void *mem, void *info);
|
1999-09-29 08:30:47 +08:00
|
|
|
|
|
|
|
/****************************************************************
|
|
|
|
**
|
|
|
|
** test_vlstr_alloc_custom(): Test VL datatype custom memory
|
|
|
|
** allocation routines. This routine just uses malloc to
|
|
|
|
** allocate the memory and increments the amount of memory
|
|
|
|
** allocated.
|
2005-08-14 04:53:35 +08:00
|
|
|
**
|
1999-09-29 08:30:47 +08:00
|
|
|
****************************************************************/
|
2020-09-30 22:27:10 +08:00
|
|
|
void *
|
|
|
|
test_vlstr_alloc_custom(size_t size, void *info)
|
1999-09-29 08:30:47 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
void * ret_value = NULL; /* Pointer to return */
|
|
|
|
size_t *mem_used = (size_t *)info; /* Get the pointer to the memory used */
|
|
|
|
size_t extra; /* Extra space needed */
|
1999-09-29 08:30:47 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This weird contortion is required on the DEC Alpha to keep the
|
|
|
|
* alignment correct - QAK
|
|
|
|
*/
|
2020-09-30 22:27:10 +08:00
|
|
|
extra = MAX(sizeof(void *), sizeof(size_t));
|
1999-09-29 08:30:47 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((ret_value = HDmalloc(extra + size)) != NULL) {
|
|
|
|
*(size_t *)ret_value = size;
|
|
|
|
*mem_used += size;
|
1999-09-29 08:30:47 +08:00
|
|
|
} /* end if */
|
2020-09-30 22:27:10 +08:00
|
|
|
ret_value = ((unsigned char *)ret_value) + extra;
|
|
|
|
return (ret_value);
|
1999-09-29 08:30:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************
|
|
|
|
**
|
|
|
|
** test_vlstr_free_custom(): Test VL datatype custom memory
|
|
|
|
** allocation routines. This routine just uses free to
|
|
|
|
** release the memory and decrements the amount of memory
|
|
|
|
** allocated.
|
2005-08-14 04:53:35 +08:00
|
|
|
**
|
1999-09-29 08:30:47 +08:00
|
|
|
****************************************************************/
|
2020-09-30 22:27:10 +08:00
|
|
|
void
|
|
|
|
test_vlstr_free_custom(void *_mem, void *info)
|
1999-09-29 08:30:47 +08:00
|
|
|
{
|
|
|
|
unsigned char *mem;
|
2020-09-30 22:27:10 +08:00
|
|
|
size_t * mem_used = (size_t *)info; /* Get the pointer to the memory used */
|
|
|
|
size_t extra; /* Extra space needed */
|
1999-09-29 08:30:47 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This weird contortion is required on the DEC Alpha to keep the
|
|
|
|
* alignment correct - QAK
|
|
|
|
*/
|
2020-09-30 22:27:10 +08:00
|
|
|
extra = MAX(sizeof(void *), sizeof(size_t));
|
1999-09-29 08:30:47 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if (_mem != NULL) {
|
|
|
|
mem = ((unsigned char *)_mem) - extra;
|
|
|
|
*mem_used -= *(size_t *)((void *)mem);
|
1999-09-29 08:30:47 +08:00
|
|
|
HDfree(mem);
|
|
|
|
} /* end if */
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************
|
|
|
|
**
|
|
|
|
** test_vlstrings_basic(): Test basic VL string code.
|
|
|
|
** Tests simple VL string I/O
|
2005-08-14 04:53:35 +08:00
|
|
|
**
|
1999-09-29 08:30:47 +08:00
|
|
|
****************************************************************/
|
|
|
|
static void
|
|
|
|
test_vlstrings_basic(void)
|
|
|
|
{
|
2020-09-05 05:51:30 +08:00
|
|
|
/* Information to write */
|
2020-09-30 22:27:10 +08:00
|
|
|
const char *wdata[SPACE1_DIM1] = {
|
1999-09-29 08:30:47 +08:00
|
|
|
"Four score and seven years ago our forefathers brought forth on this continent a new nation,",
|
|
|
|
"conceived in liberty and dedicated to the proposition that all men are created equal.",
|
|
|
|
"Now we are engaged in a great civil war,",
|
2020-09-30 22:27:10 +08:00
|
|
|
"testing whether that nation or any nation so conceived and so dedicated can long endure."};
|
|
|
|
|
|
|
|
char * rdata[SPACE1_DIM1]; /* Information read in */
|
|
|
|
char * wdata2;
|
|
|
|
hid_t dataspace, dataset2;
|
|
|
|
hid_t fid1; /* HDF5 File IDs */
|
|
|
|
hid_t dataset; /* Dataset ID */
|
|
|
|
hid_t sid1; /* Dataspace ID */
|
|
|
|
hid_t tid1; /* Datatype ID */
|
|
|
|
hid_t xfer_pid; /* Dataset transfer property list ID */
|
|
|
|
hsize_t dims1[] = {SPACE1_DIM1};
|
|
|
|
hsize_t size; /* Number of bytes which will be used */
|
|
|
|
unsigned i; /* counting variable */
|
|
|
|
size_t str_used; /* String data in memory */
|
|
|
|
size_t mem_used = 0; /* Memory used during allocation */
|
|
|
|
herr_t ret; /* Generic return value */
|
1999-09-29 08:30:47 +08:00
|
|
|
|
|
|
|
/* Output message about test being performed */
|
|
|
|
MESSAGE(5, ("Testing Basic VL String Functionality\n"));
|
|
|
|
|
|
|
|
/* Create file */
|
2001-04-01 11:25:53 +08:00
|
|
|
fid1 = H5Fcreate(DATAFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
|
1999-09-29 08:30:47 +08:00
|
|
|
CHECK(fid1, FAIL, "H5Fcreate");
|
|
|
|
|
|
|
|
/* Create dataspace for datasets */
|
|
|
|
sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
|
|
|
|
CHECK(sid1, FAIL, "H5Screate_simple");
|
|
|
|
|
|
|
|
/* Create a datatype to refer to */
|
[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
|
|
|
tid1 = H5Tcopy(H5T_C_S1);
|
1999-09-29 08:30:47 +08:00
|
|
|
CHECK(tid1, FAIL, "H5Tcopy");
|
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
ret = H5Tset_size(tid1, H5T_VARIABLE);
|
1999-09-29 08:30:47 +08:00
|
|
|
CHECK(ret, FAIL, "H5Tset_size");
|
|
|
|
|
|
|
|
/* Create a 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 = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
|
|
|
CHECK(dataset, FAIL, "H5Dcreate2");
|
1999-09-29 08:30:47 +08:00
|
|
|
|
|
|
|
/* Write dataset to disk */
|
[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
|
|
|
ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
|
1999-09-29 08:30:47 +08:00
|
|
|
CHECK(ret, FAIL, "H5Dwrite");
|
|
|
|
|
2002-12-03 03:47:57 +08:00
|
|
|
dataspace = H5Screate(H5S_SCALAR);
|
2005-08-14 04:53:35 +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
|
|
|
dataset2 = H5Dcreate2(fid1, "Dataset2", tid1, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
|
|
|
CHECK(dataset, FAIL, "H5Dcreate2");
|
2002-12-03 03:47:57 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
wdata2 = (char *)HDcalloc((size_t)65534, sizeof(char));
|
2006-10-31 08:13:27 +08:00
|
|
|
HDmemset(wdata2, 'A', (size_t)65533);
|
2002-12-03 03:47:57 +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
|
|
|
ret = H5Dwrite(dataset2, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata2);
|
2002-12-03 03:47:57 +08:00
|
|
|
CHECK(ret, FAIL, "H5Dwrite");
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2002-12-03 03:47:57 +08:00
|
|
|
H5Sclose(dataspace);
|
|
|
|
H5Dclose(dataset2);
|
|
|
|
HDfree(wdata2);
|
|
|
|
|
1999-09-29 08:30:47 +08:00
|
|
|
/* Change to the custom memory allocation routines for reading VL string */
|
[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
|
|
|
xfer_pid = H5Pcreate(H5P_DATASET_XFER);
|
1999-09-29 08:30:47 +08:00
|
|
|
CHECK(xfer_pid, FAIL, "H5Pcreate");
|
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
ret = H5Pset_vlen_mem_manager(xfer_pid, test_vlstr_alloc_custom, &mem_used, test_vlstr_free_custom,
|
|
|
|
&mem_used);
|
1999-09-29 08:30:47 +08:00
|
|
|
CHECK(ret, FAIL, "H5Pset_vlen_mem_manager");
|
|
|
|
|
|
|
|
/* Make certain the correct amount of memory will be used */
|
2020-09-30 22:27:10 +08:00
|
|
|
ret = H5Dvlen_get_buf_size(dataset, tid1, sid1, &size);
|
1999-09-29 08:30:47 +08:00
|
|
|
CHECK(ret, FAIL, "H5Dvlen_get_buf_size");
|
|
|
|
|
|
|
|
/* Count the actual number of bytes used by the strings */
|
2020-09-30 22:27:10 +08:00
|
|
|
for (i = 0, str_used = 0; i < SPACE1_DIM1; i++)
|
|
|
|
str_used += HDstrlen(wdata[i]) + 1;
|
1999-09-29 08:30:47 +08:00
|
|
|
|
|
|
|
/* Compare against the strings actually written */
|
2020-09-30 22:27:10 +08:00
|
|
|
VERIFY(size, (hsize_t)str_used, "H5Dvlen_get_buf_size");
|
1999-09-29 08:30:47 +08:00
|
|
|
|
|
|
|
/* Read dataset from disk */
|
2008-08-21 23:43:34 +08:00
|
|
|
ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, xfer_pid, rdata);
|
1999-09-29 08:30:47 +08:00
|
|
|
CHECK(ret, FAIL, "H5Dread");
|
|
|
|
|
|
|
|
/* Make certain the correct amount of memory has been used */
|
2020-09-30 22:27:10 +08:00
|
|
|
VERIFY(mem_used, str_used, "H5Dread");
|
1999-09-29 08:30:47 +08:00
|
|
|
|
|
|
|
/* Compare data read in */
|
2020-09-30 22:27:10 +08:00
|
|
|
for (i = 0; i < SPACE1_DIM1; i++) {
|
|
|
|
if (HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
|
|
|
|
TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n", (int)i,
|
2020-10-24 08:13:05 +08:00
|
|
|
(int)HDstrlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i]));
|
1999-09-29 08:30:47 +08:00
|
|
|
continue;
|
|
|
|
} /* end if */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (HDstrcmp(wdata[i], rdata[i]) != 0) {
|
|
|
|
TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n", (int)i, wdata[i],
|
|
|
|
(int)i, rdata[i]);
|
1999-09-29 08:30:47 +08:00
|
|
|
continue;
|
|
|
|
} /* end if */
|
2020-09-30 22:27:10 +08:00
|
|
|
} /* end for */
|
1999-09-29 08:30:47 +08:00
|
|
|
|
|
|
|
/* Reclaim the read VL data */
|
2020-09-30 22:27:10 +08:00
|
|
|
ret = H5Treclaim(tid1, sid1, xfer_pid, rdata);
|
2019-08-15 00:41:53 +08:00
|
|
|
CHECK(ret, FAIL, "H5Treclaim");
|
1999-09-29 08:30:47 +08:00
|
|
|
|
|
|
|
/* Make certain the VL memory has been freed */
|
2020-09-30 22:27:10 +08:00
|
|
|
VERIFY(mem_used, 0, "H5Treclaim");
|
1999-09-29 08:30:47 +08:00
|
|
|
|
|
|
|
/* Close Dataset */
|
|
|
|
ret = H5Dclose(dataset);
|
|
|
|
CHECK(ret, FAIL, "H5Dclose");
|
|
|
|
|
|
|
|
/* Close datatype */
|
|
|
|
ret = H5Tclose(tid1);
|
|
|
|
CHECK(ret, FAIL, "H5Tclose");
|
|
|
|
|
|
|
|
/* Close disk dataspace */
|
|
|
|
ret = H5Sclose(sid1);
|
|
|
|
CHECK(ret, FAIL, "H5Sclose");
|
2005-08-14 04:53:35 +08:00
|
|
|
|
1999-09-29 08:30:47 +08:00
|
|
|
/* Close dataset transfer property list */
|
2001-09-27 04:29:35 +08:00
|
|
|
ret = H5Pclose(xfer_pid);
|
1999-09-29 08:30:47 +08:00
|
|
|
CHECK(ret, FAIL, "H5Pclose");
|
2005-08-14 04:53:35 +08:00
|
|
|
|
1999-09-29 08:30:47 +08:00
|
|
|
/* Close file */
|
|
|
|
ret = H5Fclose(fid1);
|
|
|
|
CHECK(ret, FAIL, "H5Fclose");
|
|
|
|
|
|
|
|
} /* end test_vlstrings_basic() */
|
|
|
|
|
2002-12-17 00:34:27 +08:00
|
|
|
/****************************************************************
|
|
|
|
**
|
2005-08-14 04:53:35 +08:00
|
|
|
** test_vlstrings_special(): Test VL string code for special
|
2002-12-17 00:34:27 +08:00
|
|
|
** string cases, nil and zero-sized.
|
2005-08-14 04:53:35 +08:00
|
|
|
**
|
2002-12-17 00:34:27 +08:00
|
|
|
****************************************************************/
|
|
|
|
static void
|
|
|
|
test_vlstrings_special(void)
|
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
const char *wdata[SPACE1_DIM1] = {"", "two", "three", "\0"};
|
2002-12-17 00:34:27 +08:00
|
|
|
const char *wdata2[SPACE1_DIM1] = {NULL, NULL, NULL, NULL};
|
2020-09-30 22:27:10 +08:00
|
|
|
char * rdata[SPACE1_DIM1]; /* Information read in */
|
|
|
|
char * fill; /* Fill value */
|
|
|
|
hid_t fid1; /* HDF5 File IDs */
|
|
|
|
hid_t dataset; /* Dataset ID */
|
|
|
|
hid_t sid1; /* Dataspace ID */
|
|
|
|
hid_t tid1; /* Datatype ID */
|
|
|
|
hid_t dcpl; /* Dataset creation property list ID */
|
|
|
|
hsize_t dims1[] = {SPACE1_DIM1};
|
|
|
|
unsigned i; /* counting variable */
|
|
|
|
herr_t ret; /* Generic return value */
|
2002-12-17 00:34:27 +08:00
|
|
|
|
|
|
|
/* Output message about test being performed */
|
|
|
|
MESSAGE(5, ("Testing Special VL Strings\n"));
|
|
|
|
|
|
|
|
/* Create file */
|
|
|
|
fid1 = H5Fcreate(DATAFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
|
|
|
|
CHECK(fid1, FAIL, "H5Fcreate");
|
|
|
|
|
|
|
|
/* Create dataspace for datasets */
|
|
|
|
sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
|
|
|
|
CHECK(sid1, FAIL, "H5Screate_simple");
|
|
|
|
|
|
|
|
/* Create a datatype to refer to */
|
[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
|
|
|
tid1 = H5Tcopy(H5T_C_S1);
|
2002-12-17 00:34:27 +08:00
|
|
|
CHECK(tid1, FAIL, "H5Tcopy");
|
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
ret = H5Tset_size(tid1, H5T_VARIABLE);
|
2002-12-17 00:34:27 +08:00
|
|
|
CHECK(ret, FAIL, "H5Tset_size");
|
|
|
|
|
|
|
|
/* Create a 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 = H5Dcreate2(fid1, "Dataset3", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
|
|
|
CHECK(dataset, FAIL, "H5Dcreate2");
|
2002-12-17 00:34:27 +08:00
|
|
|
|
2003-11-13 23:19:50 +08:00
|
|
|
/* Read from dataset before writing data */
|
[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
|
|
|
ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
|
2003-11-13 23:19:50 +08:00
|
|
|
CHECK(ret, FAIL, "H5Dread");
|
|
|
|
|
|
|
|
/* Check data read in */
|
2020-09-30 22:27:10 +08:00
|
|
|
for (i = 0; i < SPACE1_DIM1; i++)
|
|
|
|
if (rdata[i] != NULL)
|
2021-11-03 03:24:14 +08:00
|
|
|
TestErrPrintf("VL doesn't match!, rdata[%d]=%s\n", (int)i, rdata[i]);
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2002-12-17 00:34:27 +08:00
|
|
|
/* Write dataset to disk */
|
[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
|
|
|
ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
|
2002-12-17 00:34:27 +08:00
|
|
|
CHECK(ret, FAIL, "H5Dwrite");
|
|
|
|
|
|
|
|
/* Read dataset from disk */
|
[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
|
|
|
ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
|
2002-12-17 00:34:27 +08:00
|
|
|
CHECK(ret, FAIL, "H5Dread");
|
|
|
|
|
|
|
|
/* Compare data read in */
|
2020-09-30 22:27:10 +08:00
|
|
|
for (i = 0; i < SPACE1_DIM1; i++) {
|
|
|
|
if (HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
|
|
|
|
TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n", (int)i,
|
2020-10-24 08:13:05 +08:00
|
|
|
(int)HDstrlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i]));
|
2002-12-17 00:34:27 +08:00
|
|
|
continue;
|
|
|
|
} /* end if */
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((wdata[i] == NULL && rdata[i] != NULL) || (rdata[i] == NULL && wdata[i] != NULL)) {
|
2007-03-27 02:55:36 +08:00
|
|
|
TestErrPrintf("VL data values don't match!\n");
|
|
|
|
continue;
|
|
|
|
} /* end if */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (HDstrcmp(wdata[i], rdata[i]) != 0) {
|
|
|
|
TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n", (int)i, wdata[i],
|
|
|
|
(int)i, rdata[i]);
|
2002-12-17 00:34:27 +08:00
|
|
|
continue;
|
|
|
|
} /* end if */
|
2020-09-30 22:27:10 +08:00
|
|
|
} /* end for */
|
2005-08-14 04:53:35 +08:00
|
|
|
|
[svn-r6252] Purpose:
Lots of performance improvements & a couple new internal API interfaces.
Description:
Performance Improvements:
- Cached file offset & length sizes in shared file struct, to avoid
constantly looking them up in the FCPL.
- Generic property improvements:
- Added "revision" number to generic property classes to speed
up comparisons.
- Changed method of storing properties from using a hash-table
to the TBBT routines in the library.
- Share the propery names between classes and the lists derived
from them.
- Removed redundant 'def_value' buffer from each property.
- Switching code to use a "copy on write" strategy for
properties in each list, where the properties in each list
are shared with the properties in the class, until a
property's value is changed in a list.
- Fixed error in layout code which was allocating too many buffers.
- Redefined public macros of the form (H5open()/H5check, <variable>)
internally to only be (<variable>), avoiding innumerable useless
calls to H5open() and H5check_version().
- Reuse already zeroed buffers in H5F_contig_fill instead of
constantly re-zeroing them.
- Don't write fill values if writing entire dataset.
- Use gettimeofday() system call instead of time() system when
checking the modification time of a dataset.
- Added reference counted string API and use it for tracking the
names of objects opening in a file (for the ID->name code).
- Removed redundant H5P_get() calls in B-tree routines.
- Redefine H5T datatype macros internally to the library, to avoid
calling H5check redundantly.
- Keep dataspace information for dataset locally instead of reading
from disk each time. Added new module to track open objects
in a file, to allow this (which will be useful eventually for
some FPH5 metadata caching issues).
- Remove H5AC_find macro which was inlining metadata cache lookups,
and call function instead.
- Remove redundant memset() calls from H5G_namei() routine.
- Remove redundant checking of object type when locating objects
in metadata cache and rely on the address only.
- Create default dataset object to use when default dataset creation
property list is used to create datasets, bypassing querying
for all the property list values.
- Use default I/O vector size when performing raw data with the
default dataset transfer property list, instead of querying for
I/O vector size.
- Remove H5P_DEFAULT internally to the library, replacing it with
more specific default property list based on the type of
property list needed.
- Remove redundant memset() calls in object header message (H5O*)
routines.
- Remove redunant memset() calls in data I/O routines.
- Split free-list allocation routines into malloc() and calloc()-
like routines, instead of one combined routine.
- Remove lots of indirection in H5O*() routines.
- Simplify metadata cache entry comparison routine (used when
flushing entire cache out).
- Only enable metadata cache statistics when H5AC_DEBUG is turned
on, instead of always tracking them.
- Simplify address comparison macro (H5F_addr_eq).
- Remove redundant metadata cache entry protections during dataset
creation by protecting the object header once and making all
the modifications necessary for the dataset creation before
unprotecting it.
- Reduce # of "number of element in extent" computations performed
by computing and storing the value during dataspace creation.
- Simplify checking for group location's file information, when file
has not been involving in file-mounting operations.
- Use binary encoding for modification time, instead of ASCII.
- Hoist H5HL_peek calls (to get information in a local heap)
out of loops in many group routine.
- Use static variable for iterators of selections, instead of
dynamically allocation them each time.
- Lookup & insert new entries in one step, avoiding traversing
group's B-tree twice.
- Fixed memory leak in H5Gget_objname_idx() routine (tangential to
performance improvements, but fixed along the way).
- Use free-list for reference counted strings.
- Don't bother copying object names into cached group entries,
since they are re-created when an object is opened.
The benchmark I used to measure these results created several thousand
small (2K) datasets in a file and wrote out the data for them. This is
Elena's "regular.c" benchmark.
These changes resulted in approximately ~4.3x speedup of the
development branch when compared to the previous code in the
development branch and ~1.4x speedup compared to the release
branch.
Additionally, these changes reduce the total memory used (code and
data) by the development branch by ~800KB, bringing the development
branch back into the same ballpark as the release branch.
I'll send out a more detailed description of the benchmark results
as a followup note.
New internal API routines:
Added "reference counted strings" API for tracking strings that get
used by multiple owners without duplicating the strings.
Added "ternary search tree" API for text->object mappings.
Platforms tested:
Tested h5committest {arabica (fortran), eirene (fortran, C++)
modi4 (parallel, fortran)}
Other platforms/configurations tested?
FreeBSD 4.7 (sleipnir) serial & parallel
Solaris 2.6 (baldric) serial
2003-01-10 01:20:03 +08:00
|
|
|
/* Reclaim the read VL data */
|
2019-08-15 00:41:53 +08:00
|
|
|
ret = H5Treclaim(tid1, sid1, H5P_DEFAULT, rdata);
|
|
|
|
CHECK(ret, FAIL, "H5Treclaim");
|
[svn-r6252] Purpose:
Lots of performance improvements & a couple new internal API interfaces.
Description:
Performance Improvements:
- Cached file offset & length sizes in shared file struct, to avoid
constantly looking them up in the FCPL.
- Generic property improvements:
- Added "revision" number to generic property classes to speed
up comparisons.
- Changed method of storing properties from using a hash-table
to the TBBT routines in the library.
- Share the propery names between classes and the lists derived
from them.
- Removed redundant 'def_value' buffer from each property.
- Switching code to use a "copy on write" strategy for
properties in each list, where the properties in each list
are shared with the properties in the class, until a
property's value is changed in a list.
- Fixed error in layout code which was allocating too many buffers.
- Redefined public macros of the form (H5open()/H5check, <variable>)
internally to only be (<variable>), avoiding innumerable useless
calls to H5open() and H5check_version().
- Reuse already zeroed buffers in H5F_contig_fill instead of
constantly re-zeroing them.
- Don't write fill values if writing entire dataset.
- Use gettimeofday() system call instead of time() system when
checking the modification time of a dataset.
- Added reference counted string API and use it for tracking the
names of objects opening in a file (for the ID->name code).
- Removed redundant H5P_get() calls in B-tree routines.
- Redefine H5T datatype macros internally to the library, to avoid
calling H5check redundantly.
- Keep dataspace information for dataset locally instead of reading
from disk each time. Added new module to track open objects
in a file, to allow this (which will be useful eventually for
some FPH5 metadata caching issues).
- Remove H5AC_find macro which was inlining metadata cache lookups,
and call function instead.
- Remove redundant memset() calls from H5G_namei() routine.
- Remove redundant checking of object type when locating objects
in metadata cache and rely on the address only.
- Create default dataset object to use when default dataset creation
property list is used to create datasets, bypassing querying
for all the property list values.
- Use default I/O vector size when performing raw data with the
default dataset transfer property list, instead of querying for
I/O vector size.
- Remove H5P_DEFAULT internally to the library, replacing it with
more specific default property list based on the type of
property list needed.
- Remove redundant memset() calls in object header message (H5O*)
routines.
- Remove redunant memset() calls in data I/O routines.
- Split free-list allocation routines into malloc() and calloc()-
like routines, instead of one combined routine.
- Remove lots of indirection in H5O*() routines.
- Simplify metadata cache entry comparison routine (used when
flushing entire cache out).
- Only enable metadata cache statistics when H5AC_DEBUG is turned
on, instead of always tracking them.
- Simplify address comparison macro (H5F_addr_eq).
- Remove redundant metadata cache entry protections during dataset
creation by protecting the object header once and making all
the modifications necessary for the dataset creation before
unprotecting it.
- Reduce # of "number of element in extent" computations performed
by computing and storing the value during dataspace creation.
- Simplify checking for group location's file information, when file
has not been involving in file-mounting operations.
- Use binary encoding for modification time, instead of ASCII.
- Hoist H5HL_peek calls (to get information in a local heap)
out of loops in many group routine.
- Use static variable for iterators of selections, instead of
dynamically allocation them each time.
- Lookup & insert new entries in one step, avoiding traversing
group's B-tree twice.
- Fixed memory leak in H5Gget_objname_idx() routine (tangential to
performance improvements, but fixed along the way).
- Use free-list for reference counted strings.
- Don't bother copying object names into cached group entries,
since they are re-created when an object is opened.
The benchmark I used to measure these results created several thousand
small (2K) datasets in a file and wrote out the data for them. This is
Elena's "regular.c" benchmark.
These changes resulted in approximately ~4.3x speedup of the
development branch when compared to the previous code in the
development branch and ~1.4x speedup compared to the release
branch.
Additionally, these changes reduce the total memory used (code and
data) by the development branch by ~800KB, bringing the development
branch back into the same ballpark as the release branch.
I'll send out a more detailed description of the benchmark results
as a followup note.
New internal API routines:
Added "reference counted strings" API for tracking strings that get
used by multiple owners without duplicating the strings.
Added "ternary search tree" API for text->object mappings.
Platforms tested:
Tested h5committest {arabica (fortran), eirene (fortran, C++)
modi4 (parallel, fortran)}
Other platforms/configurations tested?
FreeBSD 4.7 (sleipnir) serial & parallel
Solaris 2.6 (baldric) serial
2003-01-10 01:20:03 +08:00
|
|
|
|
2002-12-17 00:34:27 +08:00
|
|
|
/* Close Dataset */
|
|
|
|
ret = H5Dclose(dataset);
|
|
|
|
CHECK(ret, FAIL, "H5Dclose");
|
|
|
|
|
|
|
|
/* Create another dataset to test nil strings */
|
[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
|
|
|
dcpl = H5Pcreate(H5P_DATASET_CREATE);
|
2003-11-13 23:19:50 +08:00
|
|
|
CHECK(dcpl, FAIL, "H5Pcreate");
|
|
|
|
|
|
|
|
/* Set the fill value for the second 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
|
|
|
fill = NULL;
|
2020-09-30 22:27:10 +08:00
|
|
|
ret = H5Pset_fill_value(dcpl, tid1, &fill);
|
2003-11-13 23:19:50 +08:00
|
|
|
CHECK(ret, FAIL, "H5Pset_fill_value");
|
|
|
|
|
[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 = H5Dcreate2(fid1, "Dataset4", tid1, sid1, H5P_DEFAULT, dcpl, H5P_DEFAULT);
|
|
|
|
CHECK(dataset, FAIL, "H5Dcreate2");
|
2002-12-17 00:34:27 +08:00
|
|
|
|
2003-11-13 23:19:50 +08:00
|
|
|
/* Close dataset creation property list */
|
|
|
|
ret = H5Pclose(dcpl);
|
|
|
|
CHECK(ret, FAIL, "H5Pclose");
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2003-11-13 23:19:50 +08:00
|
|
|
/* Read from dataset before writing data */
|
[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
|
|
|
ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
|
2003-11-13 23:19:50 +08:00
|
|
|
CHECK(ret, FAIL, "H5Dread");
|
2002-12-17 00:34:27 +08:00
|
|
|
|
2003-11-13 23:19:50 +08:00
|
|
|
/* Check data read in */
|
2020-09-30 22:27:10 +08:00
|
|
|
for (i = 0; i < SPACE1_DIM1; i++)
|
|
|
|
if (rdata[i] != NULL)
|
2021-11-03 03:24:14 +08:00
|
|
|
TestErrPrintf("VL doesn't match!, rdata[%d]=%s\n", (int)i, rdata[i]);
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2003-11-13 23:19:50 +08:00
|
|
|
/* Try to write nil strings to disk. */
|
[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
|
|
|
ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata2);
|
2003-11-13 23:19:50 +08:00
|
|
|
CHECK(ret, FAIL, "H5Dwrite");
|
|
|
|
|
|
|
|
/* Read nil strings back from disk */
|
[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
|
|
|
ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
|
2003-11-13 23:19:50 +08:00
|
|
|
CHECK(ret, FAIL, "H5Dread");
|
|
|
|
|
|
|
|
/* Check data read in */
|
2020-09-30 22:27:10 +08:00
|
|
|
for (i = 0; i < SPACE1_DIM1; i++)
|
|
|
|
if (rdata[i] != NULL)
|
2021-11-03 03:24:14 +08:00
|
|
|
TestErrPrintf("VL doesn't match!, rdata[%d]=%s\n", (int)i, rdata[i]);
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2002-12-17 00:34:27 +08:00
|
|
|
/* Close Dataset */
|
|
|
|
ret = H5Dclose(dataset);
|
|
|
|
CHECK(ret, FAIL, "H5Dclose");
|
|
|
|
|
|
|
|
/* Close datatype */
|
|
|
|
ret = H5Tclose(tid1);
|
|
|
|
CHECK(ret, FAIL, "H5Tclose");
|
|
|
|
|
|
|
|
/* Close disk dataspace */
|
|
|
|
ret = H5Sclose(sid1);
|
|
|
|
CHECK(ret, FAIL, "H5Sclose");
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2002-12-17 00:34:27 +08:00
|
|
|
/* Close file */
|
|
|
|
ret = H5Fclose(fid1);
|
|
|
|
CHECK(ret, FAIL, "H5Fclose");
|
|
|
|
}
|
|
|
|
|
2002-03-30 07:46:56 +08:00
|
|
|
/****************************************************************
|
|
|
|
**
|
|
|
|
** test_vlstring_type(): Test VL string type.
|
2005-08-14 04:53:35 +08:00
|
|
|
** Tests if VL string is treated as string.
|
2002-03-30 07:46:56 +08:00
|
|
|
**
|
|
|
|
****************************************************************/
|
2020-09-30 22:27:10 +08:00
|
|
|
static void
|
|
|
|
test_vlstring_type(void)
|
2002-03-30 07:46:56 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
hid_t fid; /* HDF5 File IDs */
|
|
|
|
hid_t tid_vlstr;
|
|
|
|
H5T_cset_t cset;
|
|
|
|
H5T_str_t pad;
|
|
|
|
htri_t vl_str; /* Whether string is VL */
|
|
|
|
herr_t ret;
|
2002-03-30 07:46:56 +08:00
|
|
|
|
|
|
|
/* Output message about test being performed */
|
|
|
|
MESSAGE(5, ("Testing VL String type\n"));
|
|
|
|
|
2002-12-04 21:04:34 +08:00
|
|
|
/* Open file */
|
2002-11-19 00:38:11 +08:00
|
|
|
fid = H5Fopen(DATAFILE, H5F_ACC_RDWR, H5P_DEFAULT);
|
|
|
|
CHECK(fid, FAIL, "H5Fopen");
|
2002-03-30 07:46:56 +08:00
|
|
|
|
|
|
|
/* Create a datatype to refer to */
|
|
|
|
tid_vlstr = H5Tcopy(H5T_C_S1);
|
|
|
|
CHECK(tid_vlstr, FAIL, "H5Tcopy");
|
|
|
|
|
2005-08-14 04:53:35 +08:00
|
|
|
/* Change padding and verify it */
|
2002-03-30 07:46:56 +08:00
|
|
|
ret = H5Tset_strpad(tid_vlstr, H5T_STR_NULLPAD);
|
|
|
|
CHECK(ret, FAIL, "H5Tset_strpad");
|
|
|
|
pad = H5Tget_strpad(tid_vlstr);
|
|
|
|
VERIFY(pad, H5T_STR_NULLPAD, "H5Tget_strpad");
|
|
|
|
|
|
|
|
/* Convert to variable-length string */
|
|
|
|
ret = H5Tset_size(tid_vlstr, H5T_VARIABLE);
|
|
|
|
CHECK(ret, FAIL, "H5Tset_size");
|
|
|
|
|
2002-11-07 05:08:45 +08:00
|
|
|
/* Check if datatype is VL string */
|
|
|
|
ret = H5Tget_class(tid_vlstr);
|
|
|
|
VERIFY(ret, H5T_STRING, "H5Tget_class");
|
|
|
|
ret = H5Tis_variable_str(tid_vlstr);
|
|
|
|
VERIFY(ret, TRUE, "H5Tis_variable_str");
|
2005-08-14 04:53:35 +08:00
|
|
|
|
[svn-r20536] Description:
Clean up various warnings & code formatting issues.
Bring changes from Coverity branch to trunk:
r20085:
Purpose: Fix coverity issue 793
Description: Modified H5S_hyper_project_simple_higher() to free the entire span
list in new_space on failure.
r20091:
This is a fix for coverity bug #1683.
Changed the two printfs to use %lu (unsigned long) for printing "dset_size".
r20162:
Purpose: Fix coverity issue 785
Description: Modified H5T_enum_nameof() to free "name" on failure if it was
allocated. Also clarified some code in H5S_hyper_rebuild_helper().
r20189:
Addressed coverity defect 783.
H5SL_new_node() in H5SL.c was failing to free space allocated in its
first alloc if the second alloc failed. Added a call to H5FL_FREE
to address this issue.
This is purely to keep coverity happy -- if this code is ever triggered,
we have much larger problems.
Note that this fix will trigger an unused return value complaint
from coverity next week.
r20190:
Fixed Coverity issues 1561 1565 and 1678 (UNUSED_VALUES) by moving checks of return values to after the function call.
r20191:
Fixed coverity issues 643 644 and 1678 (CHECKED_RETURN).
r20232:
Addressed coverity issues 923-925. Replaced calls to sprintf with calls
to HDsnprintf.
r20233:
Fix coverity issue 662. Don't try to sort 0 attributes in H5Aint.c.
r20234:
Fix coverity issue 664. Check for NULL before dereferencing in H5Gdeprec.c.
r20271:
Purpose: Fix coverity issue 784
Description: Modified H5_debug_mask() to keep a list of files opened for use as
a debugging output stream, and modified H5_term_library to close these files on
exit.
r20272:
addressed coverity issues 838 & 955. Issue was use of strcpy() -- existing
code was safe, but modified to use strncpy() to keep coverity happy.
r20273:
Addresed coverity issues 1388 and 1389.
Initialized sel_iter->type to NULL in H5S_select_iter_init.
r20275:
Purpose: Fix valgrind issue in mf.c
Description: Fixed bug (incomplete if statement) in test_mf_fs_alloc_free() so
the retrieved node gets freed.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) 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, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
2011-04-18 02:57:07 +08:00
|
|
|
/* Verify that the class detects as a string */
|
|
|
|
vl_str = H5Tdetect_class(tid_vlstr, H5T_STRING);
|
|
|
|
CHECK(vl_str, FAIL, "H5Tdetect_class");
|
|
|
|
VERIFY(vl_str, TRUE, "H5Tdetect_class");
|
|
|
|
|
2002-03-30 07:46:56 +08:00
|
|
|
/* Check default character set and padding */
|
|
|
|
cset = H5Tget_cset(tid_vlstr);
|
|
|
|
VERIFY(cset, H5T_CSET_ASCII, "H5Tget_cset");
|
|
|
|
pad = H5Tget_strpad(tid_vlstr);
|
|
|
|
VERIFY(pad, H5T_STR_NULLPAD, "H5Tget_strpad");
|
|
|
|
|
|
|
|
/* Commit variable-length string datatype to storage */
|
[svn-r14156] Description:
Add API versioning to H5Tcommit()
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 2.6 (smirom) 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
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 10:50:31 +08:00
|
|
|
ret = H5Tcommit2(fid, VLSTR_TYPE, tid_vlstr, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
|
|
|
CHECK(ret, FAIL, "H5Tcommit2");
|
2002-03-30 07:46:56 +08:00
|
|
|
|
|
|
|
/* Close datatype */
|
|
|
|
ret = H5Tclose(tid_vlstr);
|
|
|
|
CHECK(ret, FAIL, "H5Tclose");
|
2005-08-14 04:53:35 +08:00
|
|
|
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
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 2.6 (smirom) 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
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
tid_vlstr = H5Topen2(fid, VLSTR_TYPE, H5P_DEFAULT);
|
|
|
|
CHECK(tid_vlstr, FAIL, "H5Topen2");
|
2002-11-19 00:38:11 +08:00
|
|
|
|
|
|
|
ret = H5Tclose(tid_vlstr);
|
|
|
|
CHECK(ret, FAIL, "H5Tclose");
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2002-11-19 00:38:11 +08:00
|
|
|
ret = H5Fclose(fid);
|
2005-08-14 04:53:35 +08:00
|
|
|
CHECK(ret, FAIL, "H5Fclose");
|
2002-03-30 07:46:56 +08:00
|
|
|
|
2002-11-19 00:38:11 +08:00
|
|
|
fid = H5Fopen(DATAFILE, H5F_ACC_RDWR, H5P_DEFAULT);
|
|
|
|
CHECK(fid, FAIL, "H5Fopen");
|
2005-08-14 04:53:35 +08:00
|
|
|
|
|
|
|
/* Open the variable-length string datatype just created */
|
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
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 2.6 (smirom) 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
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
|
|
|
tid_vlstr = H5Topen2(fid, VLSTR_TYPE, H5P_DEFAULT);
|
|
|
|
CHECK(tid_vlstr, FAIL, "H5Topen2");
|
2002-03-30 07:46:56 +08:00
|
|
|
|
2005-08-14 04:53:35 +08:00
|
|
|
/* Verify character set and padding */
|
2002-03-30 07:46:56 +08:00
|
|
|
cset = H5Tget_cset(tid_vlstr);
|
|
|
|
VERIFY(cset, H5T_CSET_ASCII, "H5Tget_cset");
|
|
|
|
pad = H5Tget_strpad(tid_vlstr);
|
|
|
|
VERIFY(pad, H5T_STR_NULLPAD, "H5Tget_strpad");
|
|
|
|
|
|
|
|
/* Close datatype and file */
|
|
|
|
ret = H5Tclose(tid_vlstr);
|
|
|
|
CHECK(ret, FAIL, "H5Tclose");
|
|
|
|
ret = H5Fclose(fid);
|
2005-08-14 04:53:35 +08:00
|
|
|
CHECK(ret, FAIL, "H5Fclose");
|
2002-03-30 07:46:56 +08:00
|
|
|
|
|
|
|
} /* end test_vlstring_type() */
|
|
|
|
|
2003-04-23 00:23:42 +08:00
|
|
|
/****************************************************************
|
|
|
|
**
|
2003-11-13 23:19:50 +08:00
|
|
|
** test_compact_vlstring(): Test code for storing VL strings in
|
|
|
|
** compact datasets.
|
2005-08-14 04:53:35 +08:00
|
|
|
**
|
2003-04-23 00:23:42 +08:00
|
|
|
****************************************************************/
|
|
|
|
static void
|
|
|
|
test_compact_vlstring(void)
|
|
|
|
{
|
|
|
|
const char *wdata[SPACE1_DIM1] = {"one", "two", "three", "four"};
|
2020-09-30 22:27:10 +08:00
|
|
|
char * rdata[SPACE1_DIM1]; /* Information read in */
|
|
|
|
hid_t fid1; /* HDF5 File IDs */
|
|
|
|
hid_t dataset; /* Dataset ID */
|
|
|
|
hid_t sid1; /* Dataspace ID */
|
|
|
|
hid_t tid1; /* Datatype ID */
|
|
|
|
hid_t plist; /* Dataset creation property list */
|
|
|
|
hsize_t dims1[] = {SPACE1_DIM1};
|
|
|
|
unsigned i; /* counting variable */
|
|
|
|
herr_t ret; /* Generic return value */
|
2003-04-23 00:23:42 +08:00
|
|
|
|
|
|
|
/* Output message about test being performed */
|
|
|
|
MESSAGE(5, ("Testing VL Strings in compact dataset\n"));
|
|
|
|
|
|
|
|
/* Create file */
|
|
|
|
fid1 = H5Fcreate(DATAFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
|
|
|
|
CHECK(fid1, FAIL, "H5Fcreate");
|
|
|
|
|
|
|
|
/* Create dataspace for datasets */
|
|
|
|
sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
|
|
|
|
CHECK(sid1, FAIL, "H5Screate_simple");
|
|
|
|
|
|
|
|
/* Create a datatype to refer to */
|
2020-09-30 22:27:10 +08:00
|
|
|
tid1 = H5Tcopy(H5T_C_S1);
|
2003-04-23 00:23:42 +08:00
|
|
|
CHECK(tid1, FAIL, "H5Tcopy");
|
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
ret = H5Tset_size(tid1, H5T_VARIABLE);
|
2003-04-23 00:23:42 +08:00
|
|
|
CHECK(ret, FAIL, "H5Tset_size");
|
|
|
|
|
|
|
|
plist = H5Pcreate(H5P_DATASET_CREATE);
|
|
|
|
CHECK(plist, FAIL, "H5Pcreate");
|
|
|
|
|
|
|
|
ret = H5Pset_layout(plist, H5D_COMPACT);
|
|
|
|
CHECK(ret, FAIL, "H5Pset_layout");
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2003-04-23 00:23:42 +08:00
|
|
|
/* Create a 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 = H5Dcreate2(fid1, "Dataset5", tid1, sid1, H5P_DEFAULT, plist, H5P_DEFAULT);
|
|
|
|
CHECK(dataset, FAIL, "H5Dcreate2");
|
2003-04-23 00:23:42 +08:00
|
|
|
|
|
|
|
/* Write dataset to disk */
|
[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
|
|
|
ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
|
2003-04-23 00:23:42 +08:00
|
|
|
CHECK(ret, FAIL, "H5Dwrite");
|
|
|
|
|
|
|
|
/* Read dataset from disk */
|
[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
|
|
|
ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
|
2003-04-23 00:23:42 +08:00
|
|
|
CHECK(ret, FAIL, "H5Dread");
|
|
|
|
|
|
|
|
/* Compare data read in */
|
2020-09-30 22:27:10 +08:00
|
|
|
for (i = 0; i < SPACE1_DIM1; i++) {
|
|
|
|
if (HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
|
|
|
|
TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n", (int)i,
|
2020-10-24 08:13:05 +08:00
|
|
|
(int)HDstrlen(wdata[i]), (int)i, (int)HDstrlen(rdata[i]));
|
2003-04-23 00:23:42 +08:00
|
|
|
continue;
|
|
|
|
} /* end if */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (HDstrcmp(wdata[i], rdata[i]) != 0) {
|
|
|
|
TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n", (int)i, wdata[i],
|
|
|
|
(int)i, rdata[i]);
|
2003-04-23 00:23:42 +08:00
|
|
|
continue;
|
|
|
|
} /* end if */
|
2020-09-30 22:27:10 +08:00
|
|
|
} /* end for */
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2003-04-23 00:23:42 +08:00
|
|
|
/* Reclaim the read VL data */
|
2019-08-15 00:41:53 +08:00
|
|
|
ret = H5Treclaim(tid1, sid1, H5P_DEFAULT, rdata);
|
|
|
|
CHECK(ret, FAIL, "H5Treclaim");
|
2003-04-23 00:23:42 +08:00
|
|
|
|
|
|
|
/* Close Dataset */
|
|
|
|
ret = H5Dclose(dataset);
|
|
|
|
CHECK(ret, FAIL, "H5Dclose");
|
|
|
|
|
|
|
|
/* Close datatype */
|
|
|
|
ret = H5Tclose(tid1);
|
|
|
|
CHECK(ret, FAIL, "H5Tclose");
|
|
|
|
|
|
|
|
/* Close disk dataspace */
|
|
|
|
ret = H5Sclose(sid1);
|
|
|
|
CHECK(ret, FAIL, "H5Sclose");
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2003-04-23 00:23:42 +08:00
|
|
|
/* Close dataset create property list */
|
|
|
|
ret = H5Pclose(plist);
|
|
|
|
CHECK(ret, FAIL, "H5Pclose");
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2003-04-23 00:23:42 +08:00
|
|
|
/* Close file */
|
|
|
|
ret = H5Fclose(fid1);
|
|
|
|
CHECK(ret, FAIL, "H5Fclose");
|
|
|
|
} /*test_compact_vlstrings*/
|
|
|
|
|
2002-01-04 10:42:49 +08:00
|
|
|
/****************************************************************
|
|
|
|
**
|
|
|
|
** test_write_vl_string_attribute(): Test basic VL string code.
|
|
|
|
** Tests writing VL strings as attributes
|
2005-08-14 04:53:35 +08:00
|
|
|
**
|
2002-01-04 10:42:49 +08:00
|
|
|
****************************************************************/
|
2020-09-30 22:27:10 +08:00
|
|
|
static void
|
|
|
|
test_write_vl_string_attribute(void)
|
2002-01-04 10:42:49 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
hid_t file, root, dataspace, att;
|
|
|
|
hid_t type;
|
2002-01-04 10:42:49 +08:00
|
|
|
herr_t ret;
|
2020-09-30 22:27:10 +08:00
|
|
|
char * string_att_check = NULL;
|
2002-01-04 10:42:49 +08:00
|
|
|
|
2002-12-04 21:04:34 +08:00
|
|
|
/* Open the file */
|
|
|
|
file = H5Fopen(DATAFILE, H5F_ACC_RDWR, H5P_DEFAULT);
|
2002-11-19 00:38:11 +08:00
|
|
|
CHECK(file, FAIL, "H5Fopen");
|
2002-01-04 10:42:49 +08:00
|
|
|
|
|
|
|
/* Create a datatype to refer to. */
|
2020-09-30 22:27:10 +08:00
|
|
|
type = H5Tcopy(H5T_C_S1);
|
2002-01-04 10:42:49 +08:00
|
|
|
CHECK(type, FAIL, "H5Tcopy");
|
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
ret = H5Tset_size(type, H5T_VARIABLE);
|
2002-01-04 10:42:49 +08:00
|
|
|
CHECK(ret, FAIL, "H5Tset_size");
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
root = H5Gopen2(file, "/", H5P_DEFAULT);
|
|
|
|
CHECK(root, FAIL, "H5Gopen2");
|
2002-01-04 10:42:49 +08:00
|
|
|
|
|
|
|
dataspace = H5Screate(H5S_SCALAR);
|
|
|
|
CHECK(dataspace, FAIL, "H5Screate");
|
|
|
|
|
2002-12-04 21:04:34 +08:00
|
|
|
/* Test creating a "normal" sized string attribute */
|
[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
|
|
|
att = H5Acreate2(root, "test_scalar", type, dataspace, H5P_DEFAULT, H5P_DEFAULT);
|
[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
|
|
|
CHECK(att, FAIL, "H5Acreate2");
|
2002-01-04 10:42:49 +08:00
|
|
|
|
2002-12-04 21:04:34 +08:00
|
|
|
ret = H5Awrite(att, type, &string_att);
|
|
|
|
CHECK(ret, FAIL, "H5Awrite");
|
|
|
|
|
[svn-r19278] Description:
More fixes to memory allocation, etc. exposed by valgrind.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) 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, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-08-24 04:56:42 +08:00
|
|
|
ret = H5Aread(att, type, &string_att_check);
|
|
|
|
CHECK(ret, FAIL, "H5Aread");
|
2002-12-04 21:04:34 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if (HDstrcmp(string_att_check, string_att) != 0)
|
|
|
|
TestErrPrintf("VL string attributes don't match!, string_att=%s, string_att_check=%s\n", string_att,
|
|
|
|
string_att_check);
|
2010-03-07 05:19:57 +08:00
|
|
|
|
2016-01-01 14:28:04 +08:00
|
|
|
H5free_memory(string_att_check);
|
[svn-r19278] Description:
More fixes to memory allocation, etc. exposed by valgrind.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) 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, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-08-24 04:56:42 +08:00
|
|
|
string_att_check = NULL;
|
2002-12-04 21:04:34 +08:00
|
|
|
|
|
|
|
ret = H5Aclose(att);
|
|
|
|
CHECK(ret, FAIL, "HAclose");
|
|
|
|
|
|
|
|
/* Test creating a "large" sized string attribute */
|
[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
|
|
|
att = H5Acreate2(root, "test_scalar_large", type, dataspace, H5P_DEFAULT, H5P_DEFAULT);
|
[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
|
|
|
CHECK(att, FAIL, "H5Acreate2");
|
2002-12-04 21:04:34 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
string_att_write = (char *)HDcalloc((size_t)8192, sizeof(char));
|
2006-10-31 08:13:27 +08:00
|
|
|
HDmemset(string_att_write, 'A', (size_t)8191);
|
2002-12-03 03:47:57 +08:00
|
|
|
|
|
|
|
ret = H5Awrite(att, type, &string_att_write);
|
2002-01-04 10:42:49 +08:00
|
|
|
CHECK(ret, FAIL, "H5Awrite");
|
|
|
|
|
[svn-r19278] Description:
More fixes to memory allocation, etc. exposed by valgrind.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) 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, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-08-24 04:56:42 +08:00
|
|
|
ret = H5Aread(att, type, &string_att_check);
|
|
|
|
CHECK(ret, FAIL, "H5Aread");
|
2010-03-07 05:19:57 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if (HDstrcmp(string_att_check, string_att_write) != 0)
|
|
|
|
TestErrPrintf("VL string attributes don't match!, string_att_write=%s, string_att_check=%s\n",
|
|
|
|
string_att_write, string_att_check);
|
2010-03-07 05:19:57 +08:00
|
|
|
|
2016-01-01 14:28:04 +08:00
|
|
|
H5free_memory(string_att_check);
|
[svn-r19278] Description:
More fixes to memory allocation, etc. exposed by valgrind.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) 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, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-08-24 04:56:42 +08:00
|
|
|
string_att_check = NULL;
|
2002-01-04 10:42:49 +08:00
|
|
|
|
2002-12-04 21:04:34 +08:00
|
|
|
/* The attribute string written is freed below, in the test_read_vl_string_attribute() test */
|
|
|
|
/* HDfree(string_att_write); */
|
2002-01-04 10:42:49 +08:00
|
|
|
|
|
|
|
ret = H5Aclose(att);
|
|
|
|
CHECK(ret, FAIL, "HAclose");
|
|
|
|
|
|
|
|
ret = H5Gclose(root);
|
|
|
|
CHECK(ret, FAIL, "H5Gclose");
|
|
|
|
|
|
|
|
ret = H5Tclose(type);
|
|
|
|
CHECK(ret, FAIL, "H5Tclose");
|
|
|
|
|
|
|
|
ret = H5Sclose(dataspace);
|
|
|
|
CHECK(ret, FAIL, "H5Sclose");
|
|
|
|
|
|
|
|
ret = H5Fclose(file);
|
|
|
|
CHECK(ret, FAIL, "H5Fclose");
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************
|
|
|
|
**
|
|
|
|
** test_read_vl_string_attribute(): Test basic VL string code.
|
|
|
|
** Tests reading VL strings from attributes
|
2005-08-14 04:53:35 +08:00
|
|
|
**
|
2002-01-04 10:42:49 +08:00
|
|
|
****************************************************************/
|
2020-09-30 22:27:10 +08:00
|
|
|
static void
|
|
|
|
test_read_vl_string_attribute(void)
|
2002-01-04 10:42:49 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
hid_t file, root, att;
|
|
|
|
hid_t type;
|
2002-01-04 10:42:49 +08:00
|
|
|
herr_t ret;
|
2020-09-30 22:27:10 +08:00
|
|
|
char * string_att_check = NULL;
|
2002-01-04 10:42:49 +08:00
|
|
|
|
2002-12-04 21:04:34 +08:00
|
|
|
/* Open file */
|
2002-01-04 10:42:49 +08:00
|
|
|
file = H5Fopen(DATAFILE, H5F_ACC_RDONLY, H5P_DEFAULT);
|
|
|
|
CHECK(file, FAIL, "H5Fopen");
|
|
|
|
|
|
|
|
/* Create a datatype to refer to. */
|
2020-09-30 22:27:10 +08:00
|
|
|
type = H5Tcopy(H5T_C_S1);
|
2002-01-04 10:42:49 +08:00
|
|
|
CHECK(type, FAIL, "H5Tcopy");
|
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
ret = H5Tset_size(type, H5T_VARIABLE);
|
2002-01-04 10:42:49 +08:00
|
|
|
CHECK(ret, FAIL, "H5Tset_size");
|
|
|
|
|
2007-08-28 23:02:54 +08:00
|
|
|
root = H5Gopen2(file, "/", H5P_DEFAULT);
|
|
|
|
CHECK(root, FAIL, "H5Gopen2");
|
2002-01-04 10:42:49 +08:00
|
|
|
|
2002-12-04 21:04:34 +08:00
|
|
|
/* Test reading "normal" sized string attribute */
|
[svn-r14217] Description:
Change H5Aopen -> H5Aopen_by_name, in order to be more consistent with
other new API routines.
Re-add H5Aopen as a simpler routine, to open attributes on a particular
object. (Much like the old H5Aopen_name routine).
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 00:07:20 +08:00
|
|
|
att = H5Aopen(root, "test_scalar", H5P_DEFAULT);
|
[svn-r14185] Description:
Move H5Aopen_name() routine to deprecated symbol section and replace
internal usage with H5Aopen().
Add simple regression test for H5Aopen_name() to deprecated routine
test.
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 03:29:58 +08:00
|
|
|
CHECK(att, FAIL, "H5Aopen");
|
2005-08-14 04:53:35 +08:00
|
|
|
|
[svn-r19278] Description:
More fixes to memory allocation, etc. exposed by valgrind.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) 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, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-08-24 04:56:42 +08:00
|
|
|
ret = H5Aread(att, type, &string_att_check);
|
|
|
|
CHECK(ret, FAIL, "H5Aread");
|
2002-01-04 10:42:49 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if (HDstrcmp(string_att_check, string_att) != 0)
|
|
|
|
TestErrPrintf("VL string attributes don't match!, string_att=%s, string_att_check=%s\n", string_att,
|
|
|
|
string_att_check);
|
2002-01-04 10:42:49 +08:00
|
|
|
|
2016-01-01 14:28:04 +08:00
|
|
|
H5free_memory(string_att_check);
|
[svn-r19278] Description:
More fixes to memory allocation, etc. exposed by valgrind.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) 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, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-08-24 04:56:42 +08:00
|
|
|
string_att_check = NULL;
|
2002-12-04 21:04:34 +08:00
|
|
|
|
|
|
|
ret = H5Aclose(att);
|
|
|
|
CHECK(ret, FAIL, "HAclose");
|
|
|
|
|
|
|
|
/* Test reading "large" sized string attribute */
|
[svn-r14217] Description:
Change H5Aopen -> H5Aopen_by_name, in order to be more consistent with
other new API routines.
Re-add H5Aopen as a simpler routine, to open attributes on a particular
object. (Much like the old H5Aopen_name routine).
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 00:07:20 +08:00
|
|
|
att = H5Aopen(root, "test_scalar_large", H5P_DEFAULT);
|
[svn-r14185] Description:
Move H5Aopen_name() routine to deprecated symbol section and replace
internal usage with H5Aopen().
Add simple regression test for H5Aopen_name() to deprecated routine
test.
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 03:29:58 +08:00
|
|
|
CHECK(att, FAIL, "H5Aopen");
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if (string_att_write) {
|
2010-03-07 05:19:57 +08:00
|
|
|
ret = H5Aread(att, type, &string_att_check);
|
|
|
|
CHECK(ret, FAIL, "H5Aread");
|
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if (HDstrcmp(string_att_check, string_att_write) != 0)
|
|
|
|
TestErrPrintf("VL string attributes don't match!, string_att_write=%s, string_att_check=%s\n",
|
|
|
|
string_att_write, string_att_check);
|
2002-12-04 21:04:34 +08:00
|
|
|
|
2016-01-01 14:28:04 +08:00
|
|
|
H5free_memory(string_att_check);
|
[svn-r19278] Description:
More fixes to memory allocation, etc. exposed by valgrind.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) 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, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-08-24 04:56:42 +08:00
|
|
|
string_att_check = NULL;
|
2010-03-07 05:19:57 +08:00
|
|
|
}
|
2002-12-04 21:04:34 +08:00
|
|
|
|
2010-03-07 05:19:57 +08:00
|
|
|
/* Free string allocated in test_write_vl_string_attribute */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (string_att_write)
|
2010-03-07 05:19:57 +08:00
|
|
|
HDfree(string_att_write);
|
2002-01-04 10:42:49 +08:00
|
|
|
|
|
|
|
ret = H5Aclose(att);
|
|
|
|
CHECK(ret, FAIL, "HAclose");
|
|
|
|
|
|
|
|
ret = H5Tclose(type);
|
|
|
|
CHECK(ret, FAIL, "H5Tclose");
|
|
|
|
|
|
|
|
ret = H5Gclose(root);
|
|
|
|
CHECK(ret, FAIL, "H5Gclose");
|
|
|
|
|
|
|
|
ret = H5Fclose(file);
|
|
|
|
CHECK(ret, FAIL, "H5Fclose");
|
|
|
|
}
|
|
|
|
|
2004-01-14 02:00:59 +08:00
|
|
|
/* Helper routine for test_vl_rewrite() */
|
2020-09-30 22:27:10 +08:00
|
|
|
static void
|
|
|
|
write_scalar_dset(hid_t file, hid_t type, hid_t space, char *name, char *data)
|
2004-01-14 02:00:59 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
hid_t dset;
|
|
|
|
herr_t ret;
|
2004-01-14 02:00:59 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
dset = H5Dcreate2(file, name, type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
|
|
|
CHECK(dset, FAIL, "H5Dcreate2");
|
2004-01-14 02:00:59 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
ret = H5Dwrite(dset, type, space, space, H5P_DEFAULT, &data);
|
|
|
|
CHECK(ret, FAIL, "H5Dwrite");
|
2004-01-14 02:00:59 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
ret = H5Dclose(dset);
|
|
|
|
CHECK(ret, FAIL, "H5Dclose");
|
2004-01-14 02:00:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Helper routine for test_vl_rewrite() */
|
2020-09-30 22:27:10 +08:00
|
|
|
static void
|
|
|
|
read_scalar_dset(hid_t file, hid_t type, hid_t space, char *name, char *data)
|
2004-01-14 02:00:59 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
hid_t dset;
|
2004-01-14 02:00:59 +08:00
|
|
|
herr_t ret;
|
2020-09-30 22:27:10 +08:00
|
|
|
char * data_read;
|
2004-01-14 02:00:59 +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
|
|
|
dset = H5Dopen2(file, name, H5P_DEFAULT);
|
|
|
|
CHECK(dset, FAIL, "H5Dopen2");
|
2004-01-14 02:00:59 +08:00
|
|
|
|
|
|
|
ret = H5Dread(dset, type, space, space, H5P_DEFAULT, &data_read);
|
|
|
|
CHECK(ret, FAIL, "H5Dread");
|
|
|
|
|
|
|
|
ret = H5Dclose(dset);
|
|
|
|
CHECK(ret, FAIL, "H5Dclose");
|
|
|
|
|
2021-03-11 02:42:35 +08:00
|
|
|
if (HDstrcmp(data, data_read) != 0)
|
2004-01-14 02:00:59 +08:00
|
|
|
TestErrPrintf("Expected %s for dataset %s but read %s\n", data, name, data_read);
|
|
|
|
|
2019-08-15 00:41:53 +08:00
|
|
|
ret = H5Treclaim(type, space, H5P_DEFAULT, &data_read);
|
|
|
|
CHECK(ret, FAIL, "H5Treclaim");
|
2004-01-14 02:00:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************
|
|
|
|
**
|
|
|
|
** test_vl_rewrite(): Test basic VL string code.
|
|
|
|
** Tests I/O on VL strings when lots of objects in the file
|
|
|
|
** have been linked/unlinked.
|
2005-08-14 04:53:35 +08:00
|
|
|
**
|
2004-01-14 02:00:59 +08:00
|
|
|
****************************************************************/
|
2020-09-30 22:27:10 +08:00
|
|
|
static void
|
|
|
|
test_vl_rewrite(void)
|
2004-01-14 02:00:59 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
hid_t file1, file2; /* File IDs */
|
|
|
|
hid_t type; /* VL string datatype ID */
|
|
|
|
hid_t space; /* Scalar dataspace */
|
|
|
|
char name[256]; /* Buffer for names & data */
|
|
|
|
int i; /* Local index variable */
|
|
|
|
herr_t ret; /* Generic return value */
|
2004-01-14 02:00:59 +08:00
|
|
|
|
|
|
|
/* Create the VL string datatype */
|
|
|
|
type = H5Tcopy(H5T_C_S1);
|
|
|
|
CHECK(type, FAIL, "H5Tcopy");
|
|
|
|
|
|
|
|
ret = H5Tset_size(type, H5T_VARIABLE);
|
|
|
|
CHECK(ret, FAIL, "H5Tset_size");
|
|
|
|
|
|
|
|
/* Create the scalar dataspace */
|
|
|
|
space = H5Screate(H5S_SCALAR);
|
|
|
|
CHECK(space, FAIL, "H5Screate");
|
|
|
|
|
|
|
|
/* Open the files */
|
|
|
|
file1 = H5Fcreate(DATAFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
|
|
|
|
CHECK(file1, FAIL, "H5Fcreate");
|
|
|
|
|
|
|
|
file2 = H5Fcreate(DATAFILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
|
|
|
|
CHECK(file1, FAIL, "H5Fcreate");
|
|
|
|
|
|
|
|
/* Create in file 1 */
|
2020-09-30 22:27:10 +08:00
|
|
|
for (i = 0; i < REWRITE_NDATASETS; i++) {
|
2022-01-29 06:43:48 +08:00
|
|
|
HDsnprintf(name, sizeof(name), "/set_%d", i);
|
2004-01-14 02:00:59 +08:00
|
|
|
write_scalar_dset(file1, type, space, name, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Effectively copy data from file 1 to 2 */
|
2020-09-30 22:27:10 +08:00
|
|
|
for (i = 0; i < REWRITE_NDATASETS; i++) {
|
2022-01-29 06:43:48 +08:00
|
|
|
HDsnprintf(name, sizeof(name), "/set_%d", i);
|
2004-01-14 02:00:59 +08:00
|
|
|
read_scalar_dset(file1, type, space, name, name);
|
|
|
|
write_scalar_dset(file2, type, space, name, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Read back from file 2 */
|
2020-09-30 22:27:10 +08:00
|
|
|
for (i = 0; i < REWRITE_NDATASETS; i++) {
|
2022-01-29 06:43:48 +08:00
|
|
|
HDsnprintf(name, sizeof(name), "/set_%d", i);
|
2004-01-14 02:00:59 +08:00
|
|
|
read_scalar_dset(file2, type, space, name, name);
|
2007-08-30 04:44:19 +08:00
|
|
|
} /* end for */
|
2004-01-14 02:00:59 +08:00
|
|
|
|
|
|
|
/* Remove from file 2. */
|
2020-09-30 22:27:10 +08:00
|
|
|
for (i = 0; i < REWRITE_NDATASETS; i++) {
|
2022-01-29 06:43:48 +08:00
|
|
|
HDsnprintf(name, sizeof(name), "/set_%d", i);
|
2007-08-30 04:44:19 +08:00
|
|
|
ret = H5Ldelete(file2, name, H5P_DEFAULT);
|
|
|
|
CHECK(ret, FAIL, "H5Ldelete");
|
|
|
|
} /* end for */
|
2004-01-14 02:00:59 +08:00
|
|
|
|
|
|
|
/* Effectively copy from file 1 to file 2 */
|
2020-09-30 22:27:10 +08:00
|
|
|
for (i = 0; i < REWRITE_NDATASETS; i++) {
|
2022-01-29 06:43:48 +08:00
|
|
|
HDsnprintf(name, sizeof(name), "/set_%d", i);
|
2004-01-14 02:00:59 +08:00
|
|
|
read_scalar_dset(file1, type, space, name, name);
|
|
|
|
write_scalar_dset(file2, type, space, name, name);
|
2007-08-30 04:44:19 +08:00
|
|
|
} /* end for */
|
2004-01-14 02:00:59 +08:00
|
|
|
|
|
|
|
/* Close everything */
|
|
|
|
ret = H5Tclose(type);
|
|
|
|
CHECK(ret, FAIL, "H5Tclose");
|
|
|
|
|
|
|
|
ret = H5Sclose(space);
|
|
|
|
CHECK(ret, FAIL, "H5Sclose");
|
|
|
|
|
|
|
|
ret = H5Fclose(file1);
|
|
|
|
CHECK(ret, FAIL, "H5Fclose");
|
|
|
|
|
|
|
|
ret = H5Fclose(file2);
|
|
|
|
CHECK(ret, FAIL, "H5Fclose");
|
|
|
|
} /* end test_vl_rewrite() */
|
|
|
|
|
2018-12-06 06:48:47 +08:00
|
|
|
/****************************************************************
|
|
|
|
**
|
|
|
|
** test_write_same_element():
|
|
|
|
** Tests writing to the same element of VL string using
|
|
|
|
** H5Sselect_element.
|
|
|
|
**
|
|
|
|
****************************************************************/
|
2020-09-30 22:27:10 +08:00
|
|
|
static void
|
|
|
|
test_write_same_element(void)
|
2018-12-06 06:48:47 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
hid_t file1, dataset1;
|
|
|
|
hid_t mspace, fspace, dtype;
|
|
|
|
hsize_t fdim[] = {SPACE1_DIM1};
|
2020-01-17 05:29:34 +08:00
|
|
|
const char *wdata[SPACE1_DIM1] = {"Parting", "is such a", "sweet", "sorrow."};
|
2020-09-30 22:27:10 +08:00
|
|
|
const char *val[SPACE1_DIM1] = {"But", "reuniting", "is a", "great joy"};
|
|
|
|
hsize_t marray[] = {NUMP};
|
|
|
|
hsize_t coord[SPACE1_RANK][NUMP];
|
|
|
|
herr_t ret;
|
2018-12-06 06:48:47 +08:00
|
|
|
|
2018-12-07 07:36:34 +08:00
|
|
|
file1 = H5Fcreate(DATAFILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
|
2018-12-06 06:48:47 +08:00
|
|
|
CHECK(file1, FAIL, "H5Fcreate");
|
|
|
|
|
2018-12-07 07:36:34 +08:00
|
|
|
dtype = H5Tcopy(H5T_C_S1);
|
2018-12-06 06:48:47 +08:00
|
|
|
CHECK(dtype, FAIL, "H5Tcopy");
|
|
|
|
|
2018-12-07 07:36:34 +08:00
|
|
|
ret = H5Tset_size(dtype, H5T_VARIABLE);
|
2018-12-06 06:48:47 +08:00
|
|
|
CHECK(ret, FAIL, "H5Tset_size");
|
|
|
|
|
2018-12-07 07:36:34 +08:00
|
|
|
fspace = H5Screate_simple(SPACE1_RANK, fdim, NULL);
|
2018-12-06 06:48:47 +08:00
|
|
|
CHECK(fspace, FAIL, "H5Screate_simple");
|
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
dataset1 = H5Dcreate2(file1, DATASET, dtype, fspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
|
2018-12-06 06:48:47 +08:00
|
|
|
CHECK(dataset1, FAIL, "H5Dcreate");
|
|
|
|
|
|
|
|
ret = H5Dwrite(dataset1, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
|
|
|
|
CHECK(ret, FAIL, "H5Dwrite");
|
|
|
|
|
2018-12-07 07:36:34 +08:00
|
|
|
ret = H5Dclose(dataset1);
|
2018-12-06 06:48:47 +08:00
|
|
|
CHECK(ret, FAIL, "H5Dclose");
|
|
|
|
|
2018-12-07 07:36:34 +08:00
|
|
|
ret = H5Tclose(dtype);
|
2018-12-06 06:48:47 +08:00
|
|
|
CHECK(ret, FAIL, "H5Tclose");
|
|
|
|
|
2018-12-07 07:36:34 +08:00
|
|
|
ret = H5Sclose(fspace);
|
2018-12-06 06:48:47 +08:00
|
|
|
CHECK(ret, FAIL, "H5Sclose");
|
|
|
|
|
2018-12-07 07:36:34 +08:00
|
|
|
ret = H5Fclose(file1);
|
2018-12-06 06:48:47 +08:00
|
|
|
CHECK(ret, FAIL, "H5Fclose");
|
|
|
|
|
|
|
|
/*
|
2018-12-07 07:36:34 +08:00
|
|
|
* Open the file. Select the same points, write values to those point locations.
|
2018-12-06 06:48:47 +08:00
|
|
|
*/
|
2018-12-07 07:36:34 +08:00
|
|
|
file1 = H5Fopen(DATAFILE3, H5F_ACC_RDWR, H5P_DEFAULT);
|
2018-12-06 06:48:47 +08:00
|
|
|
CHECK(file1, FAIL, "H5Fopen");
|
|
|
|
|
2018-12-12 20:53:26 +08:00
|
|
|
dataset1 = H5Dopen2(file1, DATASET, H5P_DEFAULT);
|
2018-12-06 06:48:47 +08:00
|
|
|
CHECK(dataset1, FAIL, "H5Dopen");
|
|
|
|
|
2018-12-07 07:36:34 +08:00
|
|
|
fspace = H5Dget_space(dataset1);
|
2018-12-06 06:48:47 +08:00
|
|
|
CHECK(fspace, FAIL, "H5Dget_space");
|
|
|
|
|
2018-12-07 07:36:34 +08:00
|
|
|
dtype = H5Dget_type(dataset1);
|
2018-12-06 06:48:47 +08:00
|
|
|
CHECK(dtype, FAIL, "H5Dget_type");
|
|
|
|
|
|
|
|
mspace = H5Screate_simple(1, marray, NULL);
|
|
|
|
CHECK(mspace, FAIL, "H5Screate_simple");
|
|
|
|
|
2018-12-07 07:36:34 +08:00
|
|
|
coord[0][0] = 0;
|
|
|
|
coord[0][1] = 2;
|
|
|
|
coord[0][2] = 2;
|
|
|
|
coord[0][3] = 0;
|
2018-12-06 06:48:47 +08:00
|
|
|
|
2018-12-07 07:36:34 +08:00
|
|
|
ret = H5Sselect_elements(fspace, H5S_SELECT_SET, NUMP, (const hsize_t *)&coord);
|
2018-12-06 06:48:47 +08:00
|
|
|
CHECK(ret, FAIL, "H5Sselect_elements");
|
|
|
|
|
2018-12-07 07:36:34 +08:00
|
|
|
ret = H5Dwrite(dataset1, dtype, mspace, fspace, H5P_DEFAULT, val);
|
2018-12-06 06:48:47 +08:00
|
|
|
CHECK(ret, FAIL, "H5Dwrite");
|
|
|
|
|
2018-12-07 07:36:34 +08:00
|
|
|
ret = H5Tclose(dtype);
|
2018-12-06 06:48:47 +08:00
|
|
|
CHECK(ret, FAIL, "H5Tclose");
|
|
|
|
|
2018-12-07 07:36:34 +08:00
|
|
|
ret = H5Dclose(dataset1);
|
2018-12-06 06:48:47 +08:00
|
|
|
CHECK(ret, FAIL, "H5Dclose");
|
|
|
|
|
2018-12-07 07:36:34 +08:00
|
|
|
ret = H5Sclose(fspace);
|
2018-12-06 06:48:47 +08:00
|
|
|
CHECK(ret, FAIL, "H5Dclose");
|
|
|
|
|
2018-12-07 07:36:34 +08:00
|
|
|
ret = H5Sclose(mspace);
|
2018-12-06 06:48:47 +08:00
|
|
|
CHECK(ret, FAIL, "H5Sclose");
|
|
|
|
|
2018-12-07 07:36:34 +08:00
|
|
|
ret = H5Fclose(file1);
|
2018-12-06 06:48:47 +08:00
|
|
|
CHECK(ret, FAIL, "H5Fclose");
|
|
|
|
} /* test_write_same_element */
|
|
|
|
|
1999-09-29 08:30:47 +08:00
|
|
|
/****************************************************************
|
|
|
|
**
|
|
|
|
** test_vlstrings(): Main VL string testing routine.
|
2005-08-14 04:53:35 +08:00
|
|
|
**
|
1999-09-29 08:30:47 +08:00
|
|
|
****************************************************************/
|
2005-08-14 04:53:35 +08:00
|
|
|
void
|
1999-09-29 08:30:47 +08:00
|
|
|
test_vlstrings(void)
|
|
|
|
{
|
|
|
|
/* Output message about test being performed */
|
|
|
|
MESSAGE(5, ("Testing Variable-Length Strings\n"));
|
|
|
|
|
2003-04-23 00:23:42 +08:00
|
|
|
/* These tests use the same file */
|
2002-03-30 07:46:56 +08:00
|
|
|
/* Test basic VL string datatype */
|
|
|
|
test_vlstrings_basic();
|
2002-12-17 00:34:27 +08:00
|
|
|
test_vlstrings_special();
|
2005-08-14 04:53:35 +08:00
|
|
|
test_vlstring_type();
|
|
|
|
test_compact_vlstring();
|
2002-12-04 21:04:34 +08:00
|
|
|
|
|
|
|
/* Test using VL strings in attributes */
|
|
|
|
test_write_vl_string_attribute();
|
|
|
|
test_read_vl_string_attribute();
|
2004-01-14 02:00:59 +08:00
|
|
|
|
|
|
|
/* Test writing VL datasets in files with lots of unlinking */
|
|
|
|
test_vl_rewrite();
|
2018-12-06 06:48:47 +08:00
|
|
|
/* Test writing to the same element more than once using H5Sselect_elements */
|
|
|
|
test_write_same_element();
|
2020-09-30 22:27:10 +08:00
|
|
|
} /* test_vlstrings() */
|
1999-09-29 08:30:47 +08:00
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2018-02-15 01:14:26 +08:00
|
|
|
* Function: cleanup_vlstrings
|
1999-09-29 08:30:47 +08:00
|
|
|
*
|
2018-02-15 01:14:26 +08:00
|
|
|
* Purpose: Cleanup temporary test files
|
1999-09-29 08:30:47 +08:00
|
|
|
*
|
2018-02-15 01:14:26 +08:00
|
|
|
* Return: none
|
1999-09-29 08:30:47 +08:00
|
|
|
*
|
2018-02-15 01:14:26 +08:00
|
|
|
* Programmer: Quincey Koziol
|
1999-09-29 08:30:47 +08:00
|
|
|
* September 10, 1999
|
|
|
|
*
|
|
|
|
* Modifications:
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
cleanup_vlstrings(void)
|
|
|
|
{
|
2004-01-14 02:00:59 +08:00
|
|
|
HDremove(DATAFILE);
|
|
|
|
HDremove(DATAFILE2);
|
2018-12-06 06:48:47 +08:00
|
|
|
HDremove(DATAFILE3);
|
1999-09-29 08:30:47 +08:00
|
|
|
}
|