[svn-r22024] Add HD prefix to tools library based tests. Cleaned allocation/free in tests.

Tested: local linux/ changes h5committetest against 1.8 version
This commit is contained in:
Allen Byrne 2012-03-05 09:17:14 -05:00
parent e7bbbd07df
commit 058f9c2056
8 changed files with 918 additions and 900 deletions

File diff suppressed because it is too large Load Diff

View File

@ -525,7 +525,7 @@ static int test_generate(void)
*-------------------------------------------------------------------------
*/
f = fopen( data_file, "r" ) ;
f = HDfopen( data_file, "r" ) ;
if ( f == NULL )
{
printf( "Could not find file %s. Try set $srcdir \n", data_file );
@ -572,15 +572,15 @@ static int test_generate(void)
fscanf( f, "%d %d %d", &imax, &jmax, &kmax );
fscanf( f, "%f %f %f", &valex, &xmin, &xmax );
data = (float*) malloc ( imax * jmax * kmax * sizeof( float ));
image_data = (unsigned char*) malloc ( imax * jmax * kmax * sizeof( unsigned char ));
data = (float*) HDmalloc ( imax * jmax * kmax * sizeof( float ));
image_data = (unsigned char*) HDmalloc ( imax * jmax * kmax * sizeof( unsigned char ));
for ( i = 0; i < imax * jmax * kmax; i++ )
{
fscanf( f, "%f ", &value );
data[i] = value;
}
fclose( f );
HDfclose( f );
/*-------------------------------------------------------------------------
* transform the data from floating point to unsigned char
@ -719,7 +719,7 @@ static int read_data( const char* fname, /*IN*/
*-------------------------------------------------------------------------
*/
f = fopen(data_file, "r");
f = HDfopen(data_file, "r");
if ( f == NULL )
{
printf( "Could not open file %s. Try set $srcdir \n", data_file );
@ -738,18 +738,18 @@ static int read_data( const char* fname, /*IN*/
if ( image_data )
{
free( image_data );
HDfree( image_data );
image_data=NULL;
}
image_data = (unsigned char*) malloc (w * h * color_planes * sizeof( unsigned char ));
image_data = (unsigned char*) HDmalloc (w * h * color_planes * sizeof( unsigned char ));
for (i = 0; i < h * w * color_planes ; i++)
{
fscanf( f, "%d",&n );
image_data[i] = (unsigned char)n;
}
fclose(f);
HDfclose(f);
return 1;
@ -794,46 +794,46 @@ static int read_palette(const char* fname,
return -1;
/* open the input file */
if (!(file = fopen(data_file, "r")))
if (!(file = HDfopen(data_file, "r")))
{
printf( "Could not open file %s. Try set $srcdir \n", data_file );
return -1;
}
/* read the file ident string */
if (fgets(buffer, sizeof(buffer), file) == NULL)
if (HDfgets(buffer, sizeof(buffer), file) == NULL)
{
fclose(file);
HDfclose(file);
return -1;
}
/* ensure it matches the palette file ident string */
if ( strncmp(buffer, STRING_JASC, sizeof(STRING_JASC) - 1) != 0 &&
strncmp(buffer, STRING_CWPAL, sizeof(STRING_CWPAL) - 1) != 0 )
if ( HDstrncmp(buffer, STRING_JASC, sizeof(STRING_JASC) - 1) != 0 &&
HDstrncmp(buffer, STRING_CWPAL, sizeof(STRING_CWPAL) - 1) != 0 )
{
fclose(file);
HDfclose(file);
return -1;
}
/* read the version string */
if (fgets(buffer, sizeof(buffer), file) == NULL)
if (HDfgets(buffer, sizeof(buffer), file) == NULL)
{
fclose(file);
HDfclose(file);
return -1;
}
/* ensure it matches the palette file version string */
if ( strncmp(buffer, VERSION_JASC, sizeof(VERSION_JASC) - 1) != 0 &&
strncmp(buffer, VERSION_CWPAL, sizeof(VERSION_CWPAL) - 1) != 0 )
if ( HDstrncmp(buffer, VERSION_JASC, sizeof(VERSION_JASC) - 1) != 0 &&
HDstrncmp(buffer, VERSION_CWPAL, sizeof(VERSION_CWPAL) - 1) != 0 )
{
fclose(file);
HDfclose(file);
return -1;
}
/* read the number of colors */
if (fgets(buffer, sizeof(buffer), file) == NULL)
if (HDfgets(buffer, sizeof(buffer), file) == NULL)
{
fclose(file);
HDfclose(file);
return -1;
}
@ -842,22 +842,22 @@ static int read_palette(const char* fname,
check for missing version or number of colors
in this case it reads the first entry
*/
if ( strlen( buffer ) > 4 )
if ( HDstrlen( buffer ) > 4 )
{
fclose(file);
HDfclose(file);
return -1;
}
if (sscanf(buffer, "%u", &nentries) != 1)
{
fclose(file);
HDfclose(file);
return -1;
}
/* ensure there are a sensible number of colors in the palette */
if ((nentries > 256) || (nentries > palette_size))
{
fclose(file);
HDfclose(file);
return(-1);
}
@ -867,7 +867,7 @@ static int read_palette(const char* fname,
/* extract the red, green and blue color components. */
if (fscanf(file, "%u %u %u", &red, &green, &blue) != 3)
{
fclose(file);
HDfclose(file);
return -1;
}
/* store this palette entry */
@ -877,7 +877,7 @@ static int read_palette(const char* fname,
}
/* close file */
fclose(file);
HDfclose(file);
return nentries;
}

View File

@ -367,7 +367,7 @@ static int test_dsets( void )
if ( H5LTread_dataset_string(file_id,DSET7_NAME,data_string_out) < 0 )
goto out;
if ( strcmp(data_string_in,data_string_out) != 0 )
if ( HDstrcmp(data_string_in,data_string_out) != 0 )
goto out;
@ -536,7 +536,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
if ( H5LTget_attribute_string( loc_id, obj_name, ATTR1_NAME, attr_str_out ) < 0 )
return -1;
if ( strcmp( attr_str_in, attr_str_out ) != 0 )
if ( HDstrcmp( attr_str_in, attr_str_out ) != 0 )
{
return -1;
}
@ -1015,25 +1015,25 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
TESTING("H5LTget_attribute_info");
dims_out = (hsize_t*) malloc( sizeof(hsize_t) * rank_out );
if(NULL==(dims_out = (hsize_t*) HDmalloc( sizeof(hsize_t) * rank_out ))) return -1;
if ( H5LTget_attribute_info( loc_id, obj_name, ATTR2_NAME, dims_out, &type_class,
&type_size) < 0 )
if ( H5LTget_attribute_info( loc_id, obj_name, ATTR2_NAME, dims_out, &type_class, &type_size) < 0 ) {
HDfree( dims_out );
return -1;
for (i = 0; i < rank_out; i++)
{
}
for (i = 0; i < rank_out; i++) {
if ( dims_out[i] != 5 ) {
HDfree( dims_out );
return -1;
}
}
if ( type_class != H5T_INTEGER ) {
HDfree( dims_out );
return -1;
}
if ( dims_out )
free( dims_out );
HDfree( dims_out );
PASSED();
@ -1066,12 +1066,18 @@ static int test_integers(void)
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
dt_str = (char*)calloc(str_len, sizeof(char));
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
goto out;
if(strcmp(dt_str, "H5T_STD_I8BE"))
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
HDfree(dt_str);
goto out;
free(dt_str);
}
if(HDstrcmp(dt_str, "H5T_STD_I8BE")) {
HDfree(dt_str);
goto out;
}
HDfree(dt_str);
if(H5Tclose(dtype)<0)
goto out;
@ -1117,12 +1123,18 @@ static int test_fps(void)
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
dt_str = (char*)calloc(str_len, sizeof(char));
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
goto out;
if(strcmp(dt_str, "H5T_IEEE_F32BE"))
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
HDfree(dt_str);
goto out;
free(dt_str);
}
if(HDstrcmp(dt_str, "H5T_IEEE_F32BE")) {
HDfree(dt_str);
goto out;
}
HDfree(dt_str);
if(H5Tclose(dtype)<0)
goto out;
@ -1180,14 +1192,18 @@ static int test_strings(void)
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
dt_str = (char*)calloc(str_len, sizeof(char));
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
goto out;
if(strcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) {
printf("dt=\n%s\n", dt_str);
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
HDfree(dt_str);
goto out;
}
free(dt_str);
if(HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE 13;\n STRPAD H5T_STR_NULLTERM;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) {
printf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
HDfree(dt_str);
if(H5Tclose(dtype)<0)
goto out;
@ -1208,14 +1224,18 @@ static int test_strings(void)
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
dt_str = (char*)calloc(str_len, sizeof(char));
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
goto out;
if(strcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) {
printf("dt=\n%s\n", dt_str);
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
HDfree(dt_str);
goto out;
}
free(dt_str);
if(HDstrcmp(dt_str, "H5T_STRING {\n STRSIZE H5T_VARIABLE;\n STRPAD H5T_STR_NULLPAD;\n CSET H5T_CSET_ASCII;\n CTYPE H5T_C_S1;\n }")) {
printf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
HDfree(dt_str);
if(H5Tclose(dtype)<0)
goto out;
@ -1257,14 +1277,18 @@ static int test_opaques(void)
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
dt_str = (char*)calloc(str_len, sizeof(char));
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
goto out;
if(strcmp(dt_str, "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }")) {
printf("dt=\n%s\n", dt_str);
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
HDfree(dt_str);
goto out;
}
free(dt_str);
if(HDstrcmp(dt_str, "H5T_OPAQUE {\n OPQ_SIZE 19;\n OPQ_TAG \"This is a tag for opaque type\";\n }")) {
printf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
HDfree(dt_str);
if(H5Tclose(dtype)<0)
goto out;
@ -1311,7 +1335,7 @@ static int test_enums(void)
if(H5Tenum_nameof(dtype, &value1, name1, size)<0)
goto out;
if(strcmp(name1, "BLUE"))
if(HDstrcmp(name1, "BLUE"))
goto out;
if(H5Tenum_valueof(dtype, name2, &value2)<0)
@ -1328,16 +1352,20 @@ static int test_enums(void)
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
dt_str = (char*)calloc(str_len, sizeof(char));
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
goto out;
if(strcmp(dt_str, "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }")) {
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
HDfree(dt_str);
goto out;
}
if(HDstrcmp(dt_str, "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }")) {
printf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
free(dt_str);
HDfree(dt_str);
if(H5Tclose(dtype)<0)
goto out;
@ -1385,14 +1413,18 @@ static int test_variables(void)
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
dt_str = (char*)calloc(str_len, sizeof(char));
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
goto out;
if(strcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }")) {
printf("dt=\n%s\n", dt_str);
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
HDfree(dt_str);
goto out;
}
free(dt_str);
if(HDstrcmp(dt_str, "H5T_VLEN {\n H5T_VLEN {\n H5T_STD_I32BE\n }\n }")) {
printf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
HDfree(dt_str);
if(H5Tclose(dtype)<0)
goto out;
@ -1440,15 +1472,19 @@ static int test_arrays(void)
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
dt_str = (char*)calloc(str_len, sizeof(char));
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
goto out;
if(strcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE \"arr_compound_2\" : 1;\n }\n }\n }")) {
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
HDfree(dt_str);
goto out;
}
if(HDstrcmp(dt_str, "H5T_ARRAY {\n [5][7][13] H5T_ARRAY {\n [17][19] H5T_COMPOUND {\n H5T_STD_I8BE \"arr_compound_1\" : 0;\n H5T_STD_I32BE \"arr_compound_2\" : 1;\n }\n }\n }")) {
printf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
free(dt_str);
HDfree(dt_str);
if(H5Tclose(dtype)<0)
goto out;
@ -1492,14 +1528,18 @@ static int test_compounds(void)
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
dt_str = (char*)calloc(str_len, sizeof(char));
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
goto out;
if(strcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE \"two_field\" : 6;\n }")) {
printf("dt=\n%s\n", dt_str);
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
HDfree(dt_str);
goto out;
}
free(dt_str);
if(HDstrcmp(dt_str, "H5T_COMPOUND {\n H5T_STD_I16BE \"one_field\" : 2;\n H5T_STD_U8LE \"two_field\" : 6;\n }")) {
printf("dt=\n%s\n", dt_str);
HDfree(dt_str);
goto out;
}
HDfree(dt_str);
if(H5Tclose(dtype)<0)
goto out;
@ -1509,9 +1549,11 @@ static int test_compounds(void)
if((memb_name = H5Tget_member_name(dtype, 1)) == NULL)
goto out;
if(strcmp(memb_name, "i16_field"))
if(HDstrcmp(memb_name, "i16_field")) {
HDfree(memb_name);
goto out;
free(memb_name);
}
HDfree(memb_name);
if((memb_class = H5Tget_member_class(dtype, 2))<0)
goto out;
@ -1575,17 +1617,22 @@ static int test_compound_bug(void)
if((memb_name = H5Tget_member_name(dtype, 2)) == NULL)
goto out;
if(strcmp(memb_name, "sub"))
if(HDstrcmp(memb_name, "sub")) {
HDfree(memb_name);
goto out;
free(memb_name);
}
HDfree(memb_name);
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
dt_str = (char*)calloc(str_len, sizeof(char));
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
goto out;
free(dt_str);
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
HDfree(dt_str);
goto out;
}
HDfree(dt_str);
if(H5Tclose(dtype)<0)
goto out;
@ -1607,18 +1654,23 @@ static int test_compound_bug(void)
if((memb_name = H5Tget_member_name(dtype, 1)) == NULL)
goto out;
if(strcmp(memb_name, "desc_________________________________________________________________________________________"))
if(HDstrcmp(memb_name, "desc_________________________________________________________________________________________")) {
HDfree(memb_name);
goto out;
free(memb_name);
}
HDfree(memb_name);
if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0)
goto out;
dt_str = (char*)calloc(str_len, sizeof(char));
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0)
if(NULL==(dt_str = (char*)HDcalloc(str_len, sizeof(char))))
goto out;
if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) {
HDfree(dt_str);
goto out;
}
free(dt_str);
HDfree(dt_str);
if(H5Tclose(dtype)<0)
goto out;
@ -1648,7 +1700,7 @@ static int test_complicated_compound(void)
TESTING3(" text for complicated compound types");
/* Open input file */
fp = fopen(filename, "r");
fp = HDfopen(filename, "r");
if(fp == NULL) {
printf( "Could not find file %s. Try set $srcdir \n", filename);
goto out;
@ -1658,23 +1710,23 @@ static int test_complicated_compound(void)
* Library has convenient function getline() but isn't available on
* all machines.
*/
if((line = (char*)calloc(size, sizeof(char)))==NULL)
if((line = (char*)HDcalloc(size, sizeof(char)))==NULL)
goto out;
if(fgets(line, (int)size, fp)==NULL)
if(HDfgets(line, (int)size, fp)==NULL)
goto out;
while(strlen(line)==size-1) {
while(HDstrlen(line)==size-1) {
size *= 2;
if(line)
free(line);
if((line = (char*)calloc(size, sizeof(char)))==NULL)
HDfree(line);
if((line = (char*)HDcalloc(size, sizeof(char)))==NULL)
goto out;
if(fseek(fp, 0L, SEEK_SET)!=0)
if(HDfseek(fp, 0L, SEEK_SET)!=0)
goto out;
if(fgets(line, (int)size, fp)==NULL)
if(HDfgets(line, (int)size, fp)==NULL)
goto out;
}
fclose(fp);
HDfclose(fp);
fp = NULL;
if((dtype = H5LTtext_to_dtype(line, H5LT_DDL))<0)
@ -1692,7 +1744,7 @@ static int test_complicated_compound(void)
goto out;
if(line)
free(line);
HDfree(line);
PASSED();
return 0;
@ -1700,9 +1752,9 @@ static int test_complicated_compound(void)
out:
if(line)
free(line);
HDfree(line);
if(fp)
fclose(fp);
HDfclose(fp);
H5_FAILED();
return -1;

View File

@ -72,7 +72,7 @@ static particle_t testPart[NRECORDS] = {
*/
static int cmp_par(size_t i, size_t j, particle_t *rbuf, particle_t *wbuf )
{
if ( ( strcmp( rbuf[i].name, wbuf[j].name ) != 0 ) ||
if ( ( HDstrcmp( rbuf[i].name, wbuf[j].name ) != 0 ) ||
rbuf[i].lati != wbuf[j].lati ||
rbuf[i].longi != wbuf[j].longi ||
rbuf[i].pressure != wbuf[j].pressure ||
@ -127,7 +127,7 @@ static int create_hl_table(hid_t fid)
/* Define field information */
const char *field_names[NFIELDS] =
{ "Name","Latitude", "Longitude", "Pressure", "Temperature" };
{ "Name","Latitude", "Longitude", "Pressure", "Temperature" };
hid_t field_type[NFIELDS];
hid_t string_type;
hsize_t chunk_size = 10;
@ -182,7 +182,7 @@ static int test_create_close(hid_t fid)
/* Create a datatype for the particle struct */
part_t = make_particle_type();
assert(part_t != -1);
HDassert(part_t != -1);
/* Create the table */
table = H5PTcreate_fl(fid, PT_NAME, part_t, (hsize_t)100, -1);
@ -460,7 +460,7 @@ static int test_big_table(hid_t fid)
/* Create a datatype for the particle struct */
part_t = make_particle_type();
assert(part_t != -1);
HDassert(part_t != -1);
/* Create a new table */
table = H5PTcreate_fl(fid, "Packet Test Dataset2", part_t, (hsize_t)33, -1);
@ -712,7 +712,7 @@ static int test_opaque(hid_t fid)
if ((part_t = H5Tcreate (H5T_OPAQUE, sizeof(particle_t) )) < 0 )
return -1;
assert(part_t != -1);
HDassert(part_t != -1);
/* Tag the opaque datatype */
if ( H5Tset_tag(part_t, "Opaque Particle" ) < 0)
@ -787,7 +787,7 @@ test_compress(void)
/* Create a datatype for the particle struct */
part_t = make_particle_type();
assert(part_t != -1);
HDassert(part_t != -1);
/* Create a new table with compression level 8 */
table = H5PTcreate_fl(fid1, "Compressed Test Dataset", part_t, (hsize_t)80, 8);
@ -1059,7 +1059,7 @@ int main(void)
/* create a file using default properties */
fid=H5Fcreate(TEST_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
puts("Testing packet table");
HDputs("Testing packet table");
/* run tests */
if ( test_packet_table(fid) < 0)

View File

@ -129,8 +129,8 @@ static hid_t h5file_open(const char *fname, unsigned flags)
/* open */
if ((fid = H5Fopen(data_file,flags,H5P_DEFAULT))<0)
{
fprintf(stderr,"Error: Cannot open file <%s>\n",data_file );
exit(1);
HDfprintf(stderr,"Error: Cannot open file <%s>\n",data_file );
HDexit(1);
}
return fid;
@ -142,16 +142,16 @@ static hid_t h5file_open(const char *fname, unsigned flags)
*/
static int cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf )
{
if ( ( strcmp( rbuf[i].name, wbuf[j].name ) != 0 ) ||
if ( ( HDstrcmp( rbuf[i].name, wbuf[j].name ) != 0 ) ||
rbuf[i].lati != wbuf[j].lati ||
rbuf[i].longi != wbuf[j].longi ||
rbuf[i].pressure != wbuf[j].pressure ||
rbuf[i].temperature != wbuf[j].temperature )
{
fprintf(stderr,"read and write buffers have differences\n");
fprintf(stderr,"%s %ld %f %f %d\n",
HDfprintf(stderr,"read and write buffers have differences\n");
HDfprintf(stderr,"%s %ld %f %f %d\n",
rbuf[i].name,rbuf[i].longi,rbuf[i].pressure,rbuf[i].temperature,rbuf[i].lati);
fprintf(stderr,"%s %ld %f %f %d\n",
HDfprintf(stderr,"%s %ld %f %f %d\n",
wbuf[j].name,wbuf[j].longi,wbuf[j].pressure,wbuf[j].temperature,wbuf[j].lati);
return -1;
}
@ -495,9 +495,9 @@ static int test_table(hid_t fid, int do_write)
*-------------------------------------------------------------------------
*/
if(do_write)
strcpy(tname,"table2");
HDstrcpy(tname,"table2");
else
strcpy(tname,"table1");
HDstrcpy(tname,"table1");
rstart=0;
rrecords=8;
@ -645,7 +645,7 @@ static int test_table(hid_t fid, int do_write)
wbufd[i].longi = wbuf[i].longi;
wbufd[i].pressure = wbuf[i].pressure;
wbufd[i].temperature = wbuf[i].temperature;
strcpy(wbufd[i].name, wbuf[i].name );
HDstrcpy(wbufd[i].name, wbuf[i].name );
}
@ -1027,9 +1027,9 @@ static int test_table(hid_t fid, int do_write)
rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi ||
rbuf[i].pressure != pressure_in[i-NRECORDS_ADD+1] )
{
fprintf(stderr,"%ld %f %d\n",
HDfprintf(stderr,"%ld %f %d\n",
rbuf[i].longi,rbuf[i].pressure,rbuf[i].lati);
fprintf(stderr,"%ld %f %d\n",
HDfprintf(stderr,"%ld %f %d\n",
position_in[i].longi,pressure_in[i],position_in[i].lati);
goto out;
}
@ -1144,7 +1144,7 @@ static int test_table(hid_t fid, int do_write)
/* Compare the extracted table with the initial values */
for( i = 0; i < NRECORDS; i++ )
{
if ( ( strcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
namepre_out[i].pressure != namepre_in[i].pressure ) {
goto out;
}
@ -1153,7 +1153,7 @@ static int test_table(hid_t fid, int do_write)
/* reset buffer */
for( i = 0; i < NRECORDS; i++ )
{
strcpy( namepre_out[i].name, "\0" );
HDstrcpy( namepre_out[i].name, "\0" );
namepre_out[i].pressure = -1;
}
@ -1173,7 +1173,7 @@ static int test_table(hid_t fid, int do_write)
for( i = 0; i < 3; i++ )
{
hsize_t iistart = start;
if ( ( strcmp( namepre_out[i].name, namepre_in[iistart+i].name ) != 0 ) ||
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[iistart+i].name ) != 0 ) ||
namepre_out[i].pressure != namepre_in[iistart+i].pressure ) {
goto out;
}
@ -1351,7 +1351,7 @@ static int test_table(hid_t fid, int do_write)
/* compare the extracted table with the initial values */
for( i = 0; i < NRECORDS; i++ )
{
if ( ( strcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
namepre_out[i].pressure != namepre_in[i].pressure ) {
goto out;
}
@ -1360,7 +1360,7 @@ static int test_table(hid_t fid, int do_write)
/* reset buffer */
for( i = 0; i < NRECORDS; i++ )
{
strcpy( namepre_out[i].name, "\0" );
HDstrcpy( namepre_out[i].name, "\0" );
namepre_out[i].pressure = -1;
}
@ -1382,7 +1382,7 @@ static int test_table(hid_t fid, int do_write)
for( i = 0; i < 3; i++ )
{
int iistart = (int) start;
if ( ( strcmp( namepre_out[i].name, wbuf[iistart+i].name ) != 0 ) ||
if ( ( HDstrcmp( namepre_out[i].name, wbuf[iistart+i].name ) != 0 ) ||
namepre_out[i].pressure != wbuf[iistart+i].pressure ) {
goto out;
}
@ -1423,7 +1423,7 @@ static int test_table(hid_t fid, int do_write)
/* compare the extracted table with the original array */
for( i = 0; i < NRECORDS; i++ )
{
if ( ( strcmp( rbuf2[i].name, wbuf[i].name ) != 0 ) ||
if ( ( HDstrcmp( rbuf2[i].name, wbuf[i].name ) != 0 ) ||
rbuf2[i].lati != wbuf[i].lati ||
rbuf2[i].longi != wbuf[i].longi ||
rbuf2[i].pressure != wbuf[i].pressure ||
@ -1464,7 +1464,7 @@ static int test_table(hid_t fid, int do_write)
/* compare the extracted table with the original array */
for( i = 0; i < NRECORDS; i++ )
{
if ( ( strcmp( rbuf3[i].name, wbuf[i].name ) != 0 ) ||
if ( ( HDstrcmp( rbuf3[i].name, wbuf[i].name ) != 0 ) ||
rbuf3[i].lati != wbuf[i].lati ||
rbuf3[i].longi != wbuf[i].longi ||
rbuf3[i].temperature != wbuf[i].temperature ) {
@ -1509,10 +1509,10 @@ static int test_table(hid_t fid, int do_write)
TESTING2("getting field info");
/* alocate */
names_out = (char**) malloc( sizeof(char*) * (size_t)NFIELDS );
names_out = (char**) HDmalloc( sizeof(char*) * (size_t)NFIELDS );
for ( i = 0; i < NFIELDS; i++)
{
names_out[i] = (char*) malloc( sizeof(char) * 255 );
names_out[i] = (char*) HDmalloc( sizeof(char) * 255 );
}
/* Get field info */
@ -1521,7 +1521,7 @@ static int test_table(hid_t fid, int do_write)
for ( i = 0; i < NFIELDS; i++)
{
if ( (strcmp( field_names[i], names_out[i] ) != 0)) {
if ( (HDstrcmp( field_names[i], names_out[i] ) != 0)) {
goto out;
}
}
@ -1529,9 +1529,9 @@ static int test_table(hid_t fid, int do_write)
/* release */
for ( i = 0; i < NFIELDS; i++)
{
free ( names_out[i] );
HDfree ( names_out[i] );
}
free ( names_out );
HDfree ( names_out );
PASSED();
@ -1564,7 +1564,7 @@ int main(void)
/* create a file using default properties */
fid=H5Fcreate("test_table.h5",H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT);
puts("Testing table with file creation mode (read/write in native architecture):");
HDputs("Testing table with file creation mode (read/write in native architecture):");
/* test, do write */
if (test_table(fid,1)<0)
@ -1577,7 +1577,7 @@ int main(void)
* test2: open a file written in test1 on a big-endian machine
*-------------------------------------------------------------------------
*/
puts("Testing table with file open mode (read big-endian data):");
HDputs("Testing table with file open mode (read big-endian data):");
fid=h5file_open(TEST_FILE_BE,flags);
@ -1592,7 +1592,7 @@ int main(void)
* test3: open a file written in test1 on a little-endian machine
*-------------------------------------------------------------------------
*/
puts("Testing table with file open mode (read little-endian data):");
HDputs("Testing table with file open mode (read little-endian data):");
fid=h5file_open(TEST_FILE_LE,flags);
@ -1607,7 +1607,7 @@ int main(void)
* test4: open a file written in test1 on the Cray T3 machine
*-------------------------------------------------------------------------
*/
puts("Testing table with file open mode (read Cray data):");
HDputs("Testing table with file open mode (read Cray data):");
fid=h5file_open(TEST_FILE_CRAY,flags);

View File

@ -22,14 +22,14 @@
/*
* The purpose of this test is to verify if a virtual file driver can handle:
* a. Large file (2GB)
* This should exceed 32bits I/O system since offset is a signed
* integral type (in order to support negative offset with respect to
* end of file).
* This should exceed 32bits I/O system since offset is a signed
* integral type (in order to support negative offset with respect to
* end of file).
* b. Extra Large file (4GB)
* This definite exceeds 32bit I/O and file systems.
* This definite exceeds 32bit I/O and file systems.
* c. Huge file (tens of GB)
* This verifies the HDF5 library handles big logical file size
* correctly.
* This verifies the HDF5 library handles big logical file size
* correctly.
* In practice, if a VFD can handle a big file size, there is no need to
* test the smaller file sizes. E.g., If it can handle the Huge file,
* there is no need to test the Extra large or Large files. Therefore the
@ -81,15 +81,15 @@ typedef enum vfd_t { SEC2_VFD, STDIO_VFD, FAMILY_VFD } vfd_t;
fsizes_t file_size= NOFILE;
const char *FILENAME[] = {
"big",
"sec2",
"stdio",
NULL
"big",
"sec2",
"stdio",
NULL
};
int cflag=1; /* check file system before test */
int sparse_support=0; /* sparse file supported, default false */
int have_space=0; /* enough space for huge file test, default false */
hsize_t family_size_def=FAMILY_SIZE; /* default family file size */
int cflag=1; /* check file system before test */
int sparse_support=0; /* sparse file supported, default false */
int have_space=0; /* enough space for huge file test, default false */
hsize_t family_size_def=FAMILY_SIZE; /* default family file size */
/* Protocols */
static void usage(void);
@ -216,55 +216,55 @@ supports_big(vfd_t vfd)
case FAMILY_VFD:
case SEC2_VFD:
case STDIO_VFD:
if ((fd=HDopen("y.h5", O_RDWR|O_TRUNC|O_CREAT, 0666)) < 0)
goto error;
if ((fd=HDopen("y.h5", O_RDWR|O_TRUNC|O_CREAT, 0666)) < 0)
goto error;
/* Write a few byte at the beginning */
if (5!=HDwrite(fd, "hello", (size_t)5))
goto quit;
fsize = SFILE;
/* Write a few byte at the beginning */
if (5!=HDwrite(fd, "hello", (size_t)5))
goto quit;
fsize = SFILE;
/* Write a few bytes at 2GB */
if (HDlseek(fd, 2*GB, SEEK_SET)!=2*GB)
goto quit;
if (5!=HDwrite(fd, "hello", (size_t)5))
goto quit;
fsize = LFILE;
/* Write a few bytes at 2GB */
if (HDlseek(fd, 2*GB, SEEK_SET)!=2*GB)
goto quit;
if (5!=HDwrite(fd, "hello", (size_t)5))
goto quit;
fsize = LFILE;
/* Write a few bytes at 4GB */
if (HDlseek(fd, 4*GB, SEEK_SET) != 4*GB)
goto quit;
if (5!=HDwrite(fd, "hello", (size_t)5))
goto quit;
fsize = XLFILE;
/* Write a few bytes at 4GB */
if (HDlseek(fd, 4*GB, SEEK_SET) != 4*GB)
goto quit;
if (5!=HDwrite(fd, "hello", (size_t)5))
goto quit;
fsize = XLFILE;
/* If this supports sparse_file, write a few bytes at 32GB */
if (!sparse_support)
goto quit;
if (HDlseek(fd, 32*GB, SEEK_SET) != 32*GB)
goto quit;
if (5!=HDwrite(fd, "hello", (size_t)5))
goto quit;
fsize = HUGEFILE;
/* If this supports sparse_file, write a few bytes at 32GB */
if (!sparse_support)
goto quit;
if (HDlseek(fd, 32*GB, SEEK_SET) != 32*GB)
goto quit;
if (5!=HDwrite(fd, "hello", (size_t)5))
goto quit;
fsize = HUGEFILE;
break;
break;
default:
/* unknown or unsupported VFD */
goto error;
break;
/* unknown or unsupported VFD */
goto error;
break;
}
quit:
if (HDclose(fd) < 0)
goto error;
goto error;
if (HDremove("y.h5") < 0)
goto error;
goto error;
return(fsize);
error:
if (fd >= 0){
HDclose(fd);
HDremove("y.h5");
HDclose(fd);
HDremove("y.h5");
}
return (fsize);
}
@ -300,30 +300,30 @@ enough_room(hid_t fapl)
for (i=0; i<NELMTS(fd); i++) fd[i] = -1;
/* Get file name template */
assert(H5FD_FAMILY==H5Pget_driver(fapl));
HDassert(H5FD_FAMILY==H5Pget_driver(fapl));
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
/* Create files */
for (i=0; i<NELMTS(fd); i++) {
HDsnprintf(name, sizeof name, filename, i);
if ((fd[i]=HDopen(name, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0) {
goto done;
}
if ((off_t)size != HDlseek(fd[i], (off_t)size, SEEK_SET)) {
goto done;
}
if (1!=HDwrite(fd[i], "X", (size_t)1)) {
goto done;
}
HDsnprintf(name, sizeof name, filename, i);
if ((fd[i]=HDopen(name, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0) {
goto done;
}
if ((off_t)size != HDlseek(fd[i], (off_t)size, SEEK_SET)) {
goto done;
}
if (1!=HDwrite(fd[i], "X", (size_t)1)) {
goto done;
}
}
ret_value = 1;
done:
done:
for (i=0; i<NELMTS(fd) && fd[i]>=0; i++) {
HDsnprintf(name, sizeof name, filename, i);
if(HDclose(fd[i]) < 0)
HDsnprintf(name, sizeof name, filename, i);
if(HDclose(fd[i]) < 0)
ret_value=0;
HDremove(name);
HDremove(name);
}
return ret_value;
@ -356,43 +356,43 @@ writer (char* filename, hid_t fapl, fsizes_t testsize, int wrt_n)
hsize_t hs_start[1];
hsize_t hs_size[1];
hid_t file=-1, space1=-1, space2=-1, mem_space=-1, d1=-1, d2=-1;
int *buf = (int*)malloc (sizeof(int) * WRT_SIZE);
int *buf = (int*)HDmalloc (sizeof(int) * WRT_SIZE);
int i, j;
FILE *out = fopen(DNAME, "w");
FILE *out = HDfopen(DNAME, "w");
hid_t dcpl;
switch(testsize){
case LFILE:
TESTING("Large dataset write(2GB)");
/* reduce size1 to produce a 2GB dataset */
size1[1] = 1024/16;
size2[0] /= 16;
break;
TESTING("Large dataset write(2GB)");
/* reduce size1 to produce a 2GB dataset */
size1[1] = 1024/16;
size2[0] /= 16;
break;
case XLFILE:
TESTING("Extra large dataset write(4GB)");
/* reduce size1 to produce a 4GB dataset */
size1[1] = 1024/8;
size2[0] /= 8;
break;
TESTING("Extra large dataset write(4GB)");
/* reduce size1 to produce a 4GB dataset */
size1[1] = 1024/8;
size2[0] /= 8;
break;
case HUGEFILE:
TESTING("Huge dataset write");
/* Leave size1 as 32GB */
break;
TESTING("Huge dataset write");
/* Leave size1 as 32GB */
break;
case SFILE:
TESTING("small dataset write(1GB)");
/* reduce size1 to produce a 1GB dataset */
size1[1] = 1024/32;
size2[0] /= 32;
break;
TESTING("small dataset write(1GB)");
/* reduce size1 to produce a 1GB dataset */
size1[1] = 1024/32;
size2[0] /= 32;
break;
case NOFILE:
/* what to do?? */
HDfprintf(stdout, "Unexpected file size of NOFILE\n");
goto error;
break;
/* what to do?? */
HDfprintf(stdout, "Unexpected file size of NOFILE\n");
goto error;
break;
}
/*
@ -400,30 +400,30 @@ writer (char* filename, hid_t fapl, fsizes_t testsize, int wrt_n)
* which is a family of files. Each member of the family will be 1GB
*/
if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) {
goto error;
goto error;
}
/* Create simple data spaces according to the size specified above. */
if ((space1 = H5Screate_simple (4, size1, size1)) < 0 ||
(space2 = H5Screate_simple (1, size2, size2)) < 0) {
goto error;
(space2 = H5Screate_simple (1, size2, size2)) < 0) {
goto error;
}
/* Create the datasets */
/*
* The fix below is provided for bug#921
* H5Dcreate with H5P_DEFAULT creation properties
* will create a set of solid 1GB files; test will crash if quotas are enforced
* or it will take some time to write a file.
* We should create a dataset allocating space late and never writing fill values.
* EIP 4/8/03
*/
/*
* The fix below is provided for bug#921
* H5Dcreate with H5P_DEFAULT creation properties
* will create a set of solid 1GB files; test will crash if quotas are enforced
* or it will take some time to write a file.
* We should create a dataset allocating space late and never writing fill values.
* EIP 4/8/03
*/
dcpl = H5Pcreate(H5P_DATASET_CREATE);
H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE);
H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER);
if((d1 = H5Dcreate2(file, "d1", H5T_NATIVE_INT, space1, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 ||
(d2 = H5Dcreate2(file, "d2", H5T_NATIVE_INT, space2, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
goto error;
(d2 = H5Dcreate2(file, "d2", H5T_NATIVE_INT, space2, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
goto error;
}
@ -431,15 +431,15 @@ writer (char* filename, hid_t fapl, fsizes_t testsize, int wrt_n)
hs_size[0] = WRT_SIZE;
if ((mem_space = H5Screate_simple (1, hs_size, hs_size)) < 0) goto error;
for (i=0; i<wrt_n; i++) {
hs_start[0] = randll (size2[0], i);
HDfprintf (out, "#%03d 0x%016Hx\n", i, hs_start[0]);
if (H5Sselect_hyperslab (space2, H5S_SELECT_SET, hs_start, NULL,
hs_size, NULL) < 0) goto error;
for (j=0; j<WRT_SIZE; j++) {
buf[j] = i+1;
}
if (H5Dwrite (d2, H5T_NATIVE_INT, mem_space, space2,
H5P_DEFAULT, buf) < 0) goto error;
hs_start[0] = randll (size2[0], i);
HDfprintf (out, "#%03d 0x%016Hx\n", i, hs_start[0]);
if (H5Sselect_hyperslab (space2, H5S_SELECT_SET, hs_start, NULL,
hs_size, NULL) < 0) goto error;
for (j=0; j<WRT_SIZE; j++) {
buf[j] = i+1;
}
if (H5Dwrite (d2, H5T_NATIVE_INT, mem_space, space2,
H5P_DEFAULT, buf) < 0) goto error;
}
if (H5Dclose (d1) < 0) goto error;
@ -448,22 +448,22 @@ writer (char* filename, hid_t fapl, fsizes_t testsize, int wrt_n)
if (H5Sclose (space1) < 0) goto error;
if (H5Sclose (space2) < 0) goto error;
if (H5Fclose (file) < 0) goto error;
free (buf);
fclose(out);
HDfree (buf);
HDfclose(out);
PASSED();
return 0;
error:
error:
H5E_BEGIN_TRY {
H5Dclose(d1);
H5Dclose(d2);
H5Sclose(space1);
H5Sclose(space2);
H5Sclose(mem_space);
H5Fclose(file);
H5Dclose(d1);
H5Dclose(d2);
H5Sclose(space1);
H5Sclose(space2);
H5Sclose(mem_space);
H5Fclose(file);
} H5E_END_TRY;
if (buf) free(buf);
if (out) fclose(out);
if (buf) HDfree(buf);
if (out) HDfclose(out);
return 1;
}
@ -492,11 +492,11 @@ reader(char *filename, hid_t fapl)
char ln[128], *s;
hsize_t hs_offset[1];
hsize_t hs_size[1] = {WRT_SIZE};
int *buf = (int *)malloc(sizeof(int) * WRT_SIZE);
int *buf = (int *)HDmalloc(sizeof(int) * WRT_SIZE);
int i, j, zero, wrong, nerrors = 0;
/* Open script file */
script = fopen(DNAME, "r");
script = HDfopen(DNAME, "r");
/* Open HDF5 file */
if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) FAIL_STACK_ERROR
@ -509,58 +509,58 @@ reader(char *filename, hid_t fapl)
if((mspace = H5Screate_simple(1, hs_size, hs_size)) < 0) FAIL_STACK_ERROR
/* Read each region */
while(fgets(ln, (int)sizeof(ln), script)) {
if('#' != ln[0])
while(HDfgets(ln, (int)sizeof(ln), script)) {
if('#' != ln[0])
break;
i = (int)strtol(ln + 1, &s, 10);
hs_offset[0] = HDstrtoll(s, NULL, 0);
HDfprintf(stdout, "#%03d 0x%016Hx%47s", i, hs_offset[0], "");
fflush(stdout);
i = (int)HDstrtol(ln + 1, &s, 10);
hs_offset[0] = HDstrtoll(s, NULL, 0);
HDfprintf(stdout, "#%03d 0x%016Hx%47s", i, hs_offset[0], "");
HDfflush(stdout);
if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL,
hs_size, NULL) < 0) FAIL_STACK_ERROR
if(H5Dread(d2, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, buf) < 0)
FAIL_STACK_ERROR
if(H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, NULL,
hs_size, NULL) < 0) FAIL_STACK_ERROR
if(H5Dread(d2, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, buf) < 0)
FAIL_STACK_ERROR
/* Check */
for(j = zero = wrong = 0; j < WRT_SIZE; j++) {
if(0 == buf[j])
zero++;
else if(buf[j] != i + 1)
wrong++;
}
if(zero) {
H5_FAILED();
printf(" %d zero%s\n", zero, 1 == zero ? "" : "s");
} else if(wrong) {
SKIPPED();
puts(" Possible overlap with another region.");
nerrors++;
} else {
PASSED();
}
/* Check */
for(j = zero = wrong = 0; j < WRT_SIZE; j++) {
if(0 == buf[j])
zero++;
else if(buf[j] != i + 1)
wrong++;
}
if(zero) {
H5_FAILED();
printf(" %d zero%s\n", zero, 1 == zero ? "" : "s");
} else if(wrong) {
SKIPPED();
HDputs(" Possible overlap with another region.");
nerrors++;
} else {
PASSED();
}
}
if(H5Dclose(d2) < 0) FAIL_STACK_ERROR
if(H5Sclose(mspace) < 0) FAIL_STACK_ERROR
if(H5Sclose(fspace) < 0) FAIL_STACK_ERROR
if(H5Fclose(file) < 0) FAIL_STACK_ERROR
free(buf);
fclose(script);
if(H5Sclose(mspace) < 0) FAIL_STACK_ERROR
if(H5Sclose(fspace) < 0) FAIL_STACK_ERROR
if(H5Fclose(file) < 0) FAIL_STACK_ERROR
HDfree(buf);
HDfclose(script);
return nerrors;
error:
H5E_BEGIN_TRY {
H5Dclose(d2);
H5Sclose(mspace);
H5Sclose(fspace);
H5Fclose(file);
H5Dclose(d2);
H5Sclose(mspace);
H5Sclose(fspace);
H5Fclose(file);
} H5E_END_TRY;
if(buf)
free(buf);
HDfree(buf);
if(script)
fclose(script);
HDfclose(script);
return 1;
}
@ -584,21 +584,21 @@ static void
usage(void)
{
HDfprintf(stdout,
"Usage: big [-h] [-c] [-fsize <fsize>}\n"
"\t-h\tPrint the help page\n"
"\t-c\tFile system Checking skipped. Caution: this test generates\n"
"\t\tmany big files and may fill up the file system.\n"
"\t-fsize\tChange family size default to <fsize> where <fsize> is\n"
"\t\ta positive float point number. Default value is %Hu.\n"
"Examples:\n"
"\tbig -fsize 2.1e9 \t# test with file size just under 2GB\n"
"\tbig -fsize 2.2e9 \t# test with file size just above 2GB\n"
"\tBe sure the file system can support the file size requested\n"
, (hsize_t)FAMILY_SIZE);
"Usage: big [-h] [-c] [-fsize <fsize>}\n"
"\t-h\tPrint the help page\n"
"\t-c\tFile system Checking skipped. Caution: this test generates\n"
"\t\tmany big files and may fill up the file system.\n"
"\t-fsize\tChange family size default to <fsize> where <fsize> is\n"
"\t\ta positive float point number. Default value is %Hu.\n"
"Examples:\n"
"\tbig -fsize 2.1e9 \t# test with file size just under 2GB\n"
"\tbig -fsize 2.2e9 \t# test with file size just above 2GB\n"
"\tBe sure the file system can support the file size requested\n"
, (hsize_t)FAMILY_SIZE);
}
/* Flush stdout at the end of this test routine to ensure later output to */
/* stderr will not come out before it.*/
int testvfd(vfd_t vfd)
@ -611,107 +611,107 @@ int testvfd(vfd_t vfd)
switch(vfd){
case FAMILY_VFD:
/* Test huge file with the family driver */
puts("Testing big file with the Family Driver ");
if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0)
goto error;
/* Test huge file with the family driver */
HDputs("Testing big file with the Family Driver ");
if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0)
goto error;
if (H5Pset_fapl_family(fapl, family_size_def, H5P_DEFAULT) < 0)
goto error;
if (H5Pset_fapl_family(fapl, family_size_def, H5P_DEFAULT) < 0)
goto error;
if (cflag){
/*
* We shouldn't run this test if the file system doesn't support holes
* because we would generate multi-gigabyte files.
*/
puts("Checking if file system is adequate for this test...");
if (sizeof(long long)<8 || 0==GB8LL) {
puts("Test skipped because sizeof(long long) is too small. This");
puts("hardware apparently doesn't support 64-bit integer types.");
usage();
goto quit;
}
if (!sparse_support) {
puts("Test skipped because file system does not support holes.");
usage();
goto quit;
}
if (!enough_room(fapl)) {
puts("Test skipped because of quota (file size or num open files).");
usage();
goto quit;
}
}
if (cflag){
/*
* We shouldn't run this test if the file system doesn't support holes
* because we would generate multi-gigabyte files.
*/
HDputs("Checking if file system is adequate for this test...");
if (sizeof(long long)<8 || 0==GB8LL) {
HDputs("Test skipped because sizeof(long long) is too small. This");
HDputs("hardware apparently doesn't support 64-bit integer types.");
usage();
goto quit;
}
if (!sparse_support) {
HDputs("Test skipped because file system does not support holes.");
usage();
goto quit;
}
if (!enough_room(fapl)) {
HDputs("Test skipped because of quota (file size or num open files).");
usage();
goto quit;
}
}
/* Do the test with the Family Driver */
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
/* Do the test with the Family Driver */
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if (writer(filename, fapl, HUGEFILE, WRT_N)) goto error;
if (reader(filename, fapl)) goto error;
if (writer(filename, fapl, HUGEFILE, WRT_N)) goto error;
if (reader(filename, fapl)) goto error;
puts("Test passed with the Family Driver.");
break;
HDputs("Test passed with the Family Driver.");
break;
case SEC2_VFD:
testsize = supports_big(SEC2_VFD);
if (testsize == NOFILE) {
HDfprintf(stdout, "Test for sec2 is skipped because file system does not support big files.\n");
goto quit;
}
/* Test big file with the SEC2 driver */
puts("Testing big file with the SEC2 Driver ");
testsize = supports_big(SEC2_VFD);
if (testsize == NOFILE) {
HDfprintf(stdout, "Test for sec2 is skipped because file system does not support big files.\n");
goto quit;
}
/* Test big file with the SEC2 driver */
HDputs("Testing big file with the SEC2 Driver ");
if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0)
goto error;
if(H5Pset_fapl_sec2(fapl) < 0)
goto error;
if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0)
goto error;
if(H5Pset_fapl_sec2(fapl) < 0)
goto error;
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
if (writer(filename, fapl, testsize, WRT_N)) goto error;
if (reader(filename, fapl)) goto error;
if (writer(filename, fapl, testsize, WRT_N)) goto error;
if (reader(filename, fapl)) goto error;
puts("Test passed with the SEC2 Driver.");
break;
HDputs("Test passed with the SEC2 Driver.");
break;
case STDIO_VFD:
testsize = supports_big(STDIO_VFD);
if (testsize == NOFILE) {
HDfprintf(stdout, "Test for stdio is skipped because file system does not support big files.\n");
goto quit;
}
puts("\nTesting big file with the STDIO Driver ");
testsize = supports_big(STDIO_VFD);
if (testsize == NOFILE) {
HDfprintf(stdout, "Test for stdio is skipped because file system does not support big files.\n");
goto quit;
}
HDputs("\nTesting big file with the STDIO Driver ");
if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0)
goto error;
if(H5Pset_fapl_stdio(fapl) < 0)
goto error;
if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0)
goto error;
if(H5Pset_fapl_stdio(fapl) < 0)
goto error;
h5_fixname(FILENAME[2], fapl, filename, sizeof filename);
h5_fixname(FILENAME[2], fapl, filename, sizeof filename);
if (writer(filename, fapl, testsize, WRT_N)) goto error;
if (reader(filename, fapl)) goto error;
puts("Test passed with the STDIO Driver.");
break;
if (writer(filename, fapl, testsize, WRT_N)) goto error;
if (reader(filename, fapl)) goto error;
HDputs("Test passed with the STDIO Driver.");
break;
default:
puts("Unsupprted VFD");
usage();
goto error;;
HDputs("Unsupprted VFD");
usage();
goto error;;
} /* end of switch (vfd) */
quit:
/* End with normal return code */
/* Clean up the test file */
if (h5_cleanup(FILENAME, fapl)) HDremove(DNAME);
fflush(stdout);
HDfflush(stdout);
return 0;
error:
if (fapl>=0) H5Pclose(fapl);
puts("*** TEST FAILED ***");
fflush(stdout);
HDputs("*** TEST FAILED ***");
HDfflush(stdout);
return 1;
}
@ -748,58 +748,58 @@ main (int ac, char **av)
/* parameters setup */
while (--ac > 0){
av++;
if (strcmp("-fsize", *av)==0){
/* specify a different family file size */
ac--; av++;
if (ac > 0) {
family_size_def = (hsize_t)HDstrtoull(*av, NULL, 0);
}
else{
printf("***Missing fsize value***\n");
usage();
return 1;
}
}
else if (strcmp("-c", *av)==0){
/* turn off file system check before test */
cflag=0;
}
else if (strcmp("-h", *av)==0){
usage();
return 0;
}else{
usage();
return 1;
}
av++;
if (HDstrcmp("-fsize", *av)==0){
/* specify a different family file size */
ac--; av++;
if (ac > 0) {
family_size_def = (hsize_t)HDstrtoull(*av, NULL, 0);
}
else{
printf("***Missing fsize value***\n");
usage();
return 1;
}
}
else if (HDstrcmp("-c", *av)==0){
/* turn off file system check before test */
cflag=0;
}
else if (HDstrcmp("-h", *av)==0){
usage();
return 0;
}else{
usage();
return 1;
}
}
/* check sparse file support unless cflag is not set. */
if (cflag)
sparse_support = is_sparse();
sparse_support = is_sparse();
/* Choose random # seed */
seed = (unsigned long)HDtime(NULL);
#ifdef QAK
/* seed = (unsigned long)1155438845; */
HDfprintf(stderr, "Random # seed was: %lu\n", seed);
/* seed = (unsigned long)1155438845; */
HDfprintf(stderr, "Random # seed was: %lu\n", seed);
#endif /* QAK */
HDsrandom(seed);
/*=================================================*/
/*=================================================*/
if (testvfd(FAMILY_VFD) != 0)
goto error;
goto error;
if (testvfd(SEC2_VFD) != 0)
goto error;
goto error;
if (testvfd(STDIO_VFD) != 0)
goto error;
goto error;
/* End with normal exit code */
return 0;
error:
puts("*** TEST FAILED ***");
HDputs("*** TEST FAILED ***");
return 1;
}

View File

@ -15,7 +15,7 @@
/***********************************************************
*
* Test program: tmisc
* Test program: tmisc
*
* Test miscellaneous features not tested elsewhere. Generally
* regression tests for bugs that are reported and don't
@ -23,7 +23,7 @@
*
*************************************************************/
#define H5D_PACKAGE /*suppress error about including H5Dpkg */
#define H5D_PACKAGE /*suppress error about including H5Dpkg */
/* Define this macro to indicate that the testing APIs should be available */
#define H5D_TESTING
@ -31,10 +31,10 @@
#include "hdf5.h"
#include "testhdf5.h"
#include "H5srcdir.h"
#include "H5Dpkg.h" /* Datasets */
#include "H5Dpkg.h" /* Datasets */
/* Definitions for misc. test #1 */
#define MISC1_FILE "tmisc1.h5"
#define MISC1_FILE "tmisc1.h5"
#define MISC1_VAL (13417386) /* 0xccbbaa */
#define MISC1_VAL2 (15654348) /* 0xeeddcc */
#define MISC1_DSET_NAME "/scalar_set"
@ -166,8 +166,8 @@ typedef struct
/* Definitions for misc. test #12 */
#define MISC12_FILE "tmisc12.h5"
#define MISC12_DSET_NAME "Dataset"
#define MISC12_SPACE1_RANK 1
#define MISC12_SPACE1_DIM1 4
#define MISC12_SPACE1_RANK 1
#define MISC12_SPACE1_DIM1 4
#define MISC12_CHUNK_SIZE 2
#define MISC12_APPEND_SIZE 5
@ -453,7 +453,7 @@ static void test_misc2_write_attribute(void)
ret = H5Aread(att1, type, &data_check);
CHECK(ret, FAIL, "H5Aread");
free(data_check.string);
HDfree(data_check.string);
ret = H5Aclose(att1);
CHECK(ret, FAIL, "HAclose");
@ -464,8 +464,6 @@ static void test_misc2_write_attribute(void)
ret = H5Fclose(file1);
CHECK(ret, FAIL, "H5Fclose");
root2 = H5Gopen2(file2, "/", H5P_DEFAULT);
CHECK(root2, FAIL, "H5Gopen2");
@ -480,7 +478,7 @@ static void test_misc2_write_attribute(void)
ret = H5Aread(att2, type, &data_check);
CHECK(ret, FAIL, "H5Aread");
free(data_check.string);
HDfree(data_check.string);
ret = H5Aclose(att2);
CHECK(ret, FAIL, "HAclose");
@ -497,8 +495,8 @@ static void test_misc2_write_attribute(void)
ret = H5Fclose(file2);
CHECK(ret, FAIL, "H5Fclose");
free(string_att1);
free(string_att2);
HDfree(string_att1);
HDfree(string_att2);
return;
}
@ -524,7 +522,7 @@ static void test_misc2_read_attribute(const char *filename, const char *att_name
ret = H5Aread(att, type, &data_check);
CHECK(ret, FAIL, "H5Aread");
free(data_check.string);
HDfree(data_check.string);
ret = H5Aclose(att);
CHECK(ret, FAIL, "H5Aclose");
@ -732,7 +730,7 @@ delete_struct3(misc5_struct3_hndl *str3hndl)
ret=H5Tclose(str3hndl->st3h_base);
CHECK(ret,FAIL,"H5Tclose");
free(str3hndl);
HDfree(str3hndl);
}
static void
@ -783,7 +781,7 @@ delete_struct2(misc5_struct2_hndl *str2hndl)
H5Tclose(str2hndl->st2h_base);
CHECK(ret,FAIL,"H5Tclose");
free(str2hndl);
HDfree(str2hndl);
}
static void
@ -794,7 +792,7 @@ set_struct2(misc5_struct2 *buf)
buf->st2_el1=MISC5_DBGELVAL2;
buf->st2_el2.len=MISC5_DBGNELM3;
buf->st2_el2.p=malloc((buf->st2_el2.len)*sizeof(misc5_struct3));
buf->st2_el2.p=HDmalloc((buf->st2_el2.len)*sizeof(misc5_struct3));
CHECK(buf->st2_el2.p,NULL,"malloc");
for(i=0; i<(buf->st2_el2.len); i++)
@ -804,7 +802,7 @@ set_struct2(misc5_struct2 *buf)
static void
clear_struct2(misc5_struct2 *buf)
{
free(buf->st2_el2.p);
HDfree(buf->st2_el2.p);
}
/*********************** struct1 ***********************/
@ -849,7 +847,7 @@ delete_struct1(misc5_struct1_hndl *str1hndl)
ret=H5Tclose(str1hndl->st1h_base);
CHECK(ret,FAIL,"H5Tclose");
free(str1hndl);
HDfree(str1hndl);
}
static void
@ -860,7 +858,7 @@ set_struct1(misc5_struct1 *buf)
buf->st1_el1=MISC5_DBGELVAL1;
buf->st1_el2.len=MISC5_DBGNELM2;
buf->st1_el2.p=malloc((buf->st1_el2.len)*sizeof(misc5_struct2));
buf->st1_el2.p=HDmalloc((buf->st1_el2.len)*sizeof(misc5_struct2));
CHECK(buf->st1_el2.p,NULL,"malloc");
for(i=0; i<(buf->st1_el2.len); i++)
@ -874,7 +872,7 @@ clear_struct1(misc5_struct1 *buf)
for(i=0;i<buf->st1_el2.len;i++)
clear_struct2(&((( misc5_struct2 *)(buf->st1_el2.p))[i]));
free(buf->st1_el2.p);
HDfree(buf->st1_el2.p);
}
static void
@ -910,7 +908,7 @@ test_misc5(void)
/* Create the variable-length buffer */
buf.len = MISC5_DBGNELM1;
buf.p = malloc((buf.len) * sizeof(misc5_struct1));
buf.p = HDmalloc((buf.len) * sizeof(misc5_struct1));
CHECK(buf.p, NULL, "malloc");
/* Create the top-level VL information */
@ -926,7 +924,7 @@ test_misc5(void)
clear_struct1(&(((misc5_struct1 *)(buf.p))[j]));
/* Free the variable-length buffer */
free(buf.p);
HDfree(buf.p);
/* Close dataset */
ret = H5Dclose(dataset_id);
@ -1236,10 +1234,10 @@ test_misc8(void)
MESSAGE(5, ("Testing dataset storage sizes\n"));
/* Allocate space for the data to write & read */
wdata=malloc(sizeof(int)*MISC8_DIM0*MISC8_DIM1);
wdata=HDmalloc(sizeof(int)*MISC8_DIM0*MISC8_DIM1);
CHECK(wdata,NULL,"malloc");
#ifdef VERIFY_DATA
rdata=malloc(sizeof(int)*MISC8_DIM0*MISC8_DIM1);
rdata=HDmalloc(sizeof(int)*MISC8_DIM0*MISC8_DIM1);
CHECK(rdata,NULL,"malloc");
#endif /* VERIFY_DATA */
@ -1677,7 +1675,7 @@ test_misc8(void)
CHECK(ret, FAIL, "H5Fclose");
/* Free the read & write buffers */
free(wdata);
HDfree(wdata);
#ifdef VERIFY_DATA
free(rdata);
#endif /* VERIFY_DATA */
@ -1800,10 +1798,10 @@ test_misc11(void)
unsigned sym_ik; /* Symbol table B-tree initial 'K' value */
unsigned istore_ik; /* Indexed storage B-tree initial 'K' value */
unsigned sym_lk; /* Symbol table B-tree leaf 'K' value */
unsigned nindexes; /* Shared message number of indexes */
H5F_info2_t finfo; /* global information about file */
H5F_file_space_type_t strategy; /* File/free space strategy */
hsize_t threshold; /* Free-space section threshold */
unsigned nindexes; /* Shared message number of indexes */
H5F_info2_t finfo; /* global information about file */
H5F_file_space_type_t strategy; /* File/free space strategy */
hsize_t threshold; /* Free-space section threshold */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@ -1958,10 +1956,10 @@ test_misc12(void)
hsize_t dimsn[] = {MISC12_APPEND_SIZE};
hsize_t maxdims1[1] = {H5S_UNLIMITED};
hsize_t chkdims1[1] = {MISC12_CHUNK_SIZE};
hsize_t newsize[1] = {MISC12_SPACE1_DIM1+MISC12_APPEND_SIZE};
hsize_t offset[1] = {MISC12_SPACE1_DIM1};
hsize_t count[1] = {MISC12_APPEND_SIZE};
int i; /* counting variable */
hsize_t newsize[1] = {MISC12_SPACE1_DIM1+MISC12_APPEND_SIZE};
hsize_t offset[1] = {MISC12_SPACE1_DIM1};
hsize_t count[1] = {MISC12_APPEND_SIZE};
int i; /* counting variable */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@ -2215,7 +2213,7 @@ create_hdf_file(const char *name)
/* Close the file */
ret = H5Fclose(fid);
assert(ret >= 0);
HDassert(ret >= 0);
CHECK(ret, FAIL, "H5Fclose");
}
@ -2245,7 +2243,7 @@ insert_user_block(const char *old_name, const char *new_name,const char *str,siz
VERIFY(written, size, "HDfwrite");
/* Open the old file */
old_fp=fopen(old_name,"rb");
old_fp=HDfopen(old_name,"rb");
CHECK(old_fp, NULL, "HDfopen");
/* Allocate space for the copy buffer */
@ -2268,10 +2266,10 @@ insert_user_block(const char *old_name, const char *new_name,const char *str,siz
VERIFY(ret, 0, "HDfclose");
/* Free the copy buffer */
free(copy_buf);
HDfree(copy_buf);
/* Free the user block */
free(user_block);
HDfree(user_block);
}
static void
@ -4452,7 +4450,6 @@ test_misc25a(void)
CHECK(ret, FAIL, "H5Fclose");
/* Re-open file */
fid = H5Fopen(MISC25A_FILE, H5F_ACC_RDWR, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
@ -4496,7 +4493,6 @@ test_misc25a(void)
CHECK(ret, FAIL, "H5Fclose");
/* Re-open file */
fid = H5Fopen(MISC25A_FILE, H5F_ACC_RDWR, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
@ -5125,7 +5121,7 @@ test_misc30_get_info_cb(hid_t loc_id, const char *name, const H5L_info_t UNUSED
{
H5O_info_t object_info;
return H5Oget_info_by_name(loc_id, name, &object_info, H5P_DEFAULT);
return H5Oget_info_by_name(loc_id, name, &object_info, H5P_DEFAULT);
}
static int
@ -5174,7 +5170,7 @@ test_misc30(void)
CHECK(fid, FAIL, "H5Fopen");
if(get_info) {
ret = test_misc30_get_info(fid);
ret = test_misc30_get_info(fid);
CHECK(ret, FAIL, "test_misc30_get_info");
}

View File

@ -353,7 +353,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
case 'm':
options->min_comp = atoi( opt_arg );
options->min_comp = HDatoi( opt_arg );
if ((int)options->min_comp<=0)
{
error_msg("invalid minimum compress size <%s>\n", opt_arg );
@ -375,7 +375,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
case 'c':
options->grp_compact = atoi( opt_arg );
options->grp_compact = HDatoi( opt_arg );
if (options->grp_compact>0)
options->latest = 1; /* must use latest format */
break;
@ -383,7 +383,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
case 'd':
options->grp_indexed = atoi( opt_arg );
options->grp_indexed = HDatoi( opt_arg );
if (options->grp_indexed>0)
options->latest = 1; /* must use latest format */
break;
@ -398,7 +398,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
options->latest = 1; /* must use latest format */
if (msgPtr == NULL)
{
ssize = atoi( opt_arg );
ssize = HDatoi( opt_arg );
for (idx=0; idx<5; idx++)
options->msg_size[idx] = ssize;
}
@ -407,7 +407,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
char msgType[10];
HDstrcpy(msgType, msgPtr+1);
msgPtr[0] = '\0';
ssize = atoi( opt_arg );
ssize = HDatoi( opt_arg );
if (HDstrncmp(msgType, "dspace",6) == 0) {
options->msg_size[0] = ssize;
}
@ -436,17 +436,17 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
case 'b':
options->ublock_size = (hsize_t)atol( opt_arg );
options->ublock_size = (hsize_t)HDatol( opt_arg );
break;
case 't':
options->threshold = (hsize_t)atol( opt_arg );
options->threshold = (hsize_t)HDatol( opt_arg );
break;
case 'a':
options->alignment = atol( opt_arg );
options->alignment = HDatol( opt_arg );
if ( options->alignment < 1 )
{
error_msg("invalid alignment size\n", opt_arg );
@ -476,7 +476,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
case 'T':
options->fs_threshold = (hsize_t)atol( opt_arg );
options->fs_threshold = (hsize_t)HDatol( opt_arg );
break;
} /* switch */
@ -521,7 +521,7 @@ void read_info(const char *filename,
char c;
int i, rc=1;
if ((fp = fopen(filename, "r")) == (FILE *)NULL) {
if ((fp = HDfopen(filename, "r")) == (FILE *)NULL) {
error_msg("cannot open options file %s\n", filename);
HDexit(EXIT_FAILURE);
}
@ -544,7 +544,7 @@ void read_info(const char *filename,
while( c!=' ' )
{
fscanf(fp, "%c", &c);
if (feof(fp)) break;
if (HDfeof(fp)) break;
}
c='0';
/* go until end */
@ -553,7 +553,7 @@ void read_info(const char *filename,
fscanf(fp, "%c", &c);
comp_info[i]=c;
i++;
if (feof(fp)) break;
if (HDfeof(fp)) break;
if (c==10 /*eol*/) break;
}
comp_info[i-1]='\0'; /*cut the last " */
@ -574,7 +574,7 @@ void read_info(const char *filename,
while( c!=' ' )
{
fscanf(fp, "%c", &c);
if (feof(fp)) break;
if (HDfeof(fp)) break;
}
c='0';
/* go until end */
@ -583,7 +583,7 @@ void read_info(const char *filename,
fscanf(fp, "%c", &c);
comp_info[i]=c;
i++;
if (feof(fp)) break;
if (HDfeof(fp)) break;
if (c==10 /*eol*/) break;
}
comp_info[i-1]='\0'; /*cut the last " */
@ -603,6 +603,6 @@ void read_info(const char *filename,
}
}
fclose(fp);
HDfclose(fp);
return;
}