[svn-r10779] Purpose: Bug fix

Description:
Description: See details from Bug #213.  Family member file size wasn't saved
anywhere in file.  When family file is opened, the first member size determine
the member size.

Solution:  This is the second step of fixing this bug.  Multi driver is checked against the driver
name saved in superblock.  Wrong driver will result in a failure with an error message indicating
multi driver should be used.  This change includes split driver because it's a special case for multi
driver.

In the first step of checkin.  Family member size and name template(unused at this stage) are saved
in file superblock.  When file is reopened,the size passed in thrin superblock.  A different size
will trigger a failure with an error message indicating the right size.  Wrong driver to open family
file will cause a failure, too.

Test program tries to reopen a multi file with default sec2 driver.

The third step will be changing h5repart to let it change family member size in the superblock if
user uses it to change member file size.

Platforms tested: h5committest and fuss.
This commit is contained in:
Raymond Lu 2005-05-20 16:51:05 -05:00
parent 02ca812786
commit 2ae072bb30

View File

@ -489,6 +489,17 @@ test_multi(void)
if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
goto error;
if(H5Fclose(file)<0)
goto error;
/* Test wrong ways to reopen multi files */
if(test_multi_opens(filename, fapl)<0)
goto error;
/* Reopen the file */
if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl))<0)
goto error;
/* Create and write data set */
if((space=H5Screate_simple(2, dims, NULL))<0)
goto error;
@ -571,7 +582,44 @@ error:
H5Fclose(file);
} H5E_END_TRY;
return -1;
}
}
/*-------------------------------------------------------------------------
* Function: test_multi_opens
*
* Purpose: Private function for test_multi() to tests wrong ways of
* reopening multi file.
*
* Return: Success: exit(0)
*
* Failure: exit(1)
*
* Programmer: Raymond Lu
* Thursday, May 19, 2005
*
* Modifications:
*-------------------------------------------------------------------------
*/
static herr_t
test_multi_opens(char *fname, hid_t fa_pl)
{
hid_t file;
char super_name[1024]; /*name string "%%s-s.h5"*/
char sf_name[1024]; /*name string "multi_file-s.h5"*/
/* Case: reopen with the name of super file and default property list */
sprintf(super_name, "%%s-%c.h5", 's');
sprintf(sf_name, super_name, fname);
H5E_BEGIN_TRY {
file=H5Fopen(sf_name, H5F_ACC_RDWR, H5P_DEFAULT);
} H5E_END_TRY;
return 0;
error:
return -1;
}
/*-------------------------------------------------------------------------