[svn-r7827] Purpose:

Bug fix

Description:
    Make --disable-hsizet work properly again by fixing a couple of tests and
correcting the definition of SSIZET_MAX.

Platforms tested:
    FreeBSD 4.9 (sleipnir)
    h5committest not used, as it doesn't test this configuration.
This commit is contained in:
Quincey Koziol 2003-11-08 09:21:49 -05:00
parent f809c2d352
commit dd969f1ead
3 changed files with 18 additions and 6 deletions

View File

@ -437,15 +437,15 @@
# define ULLONG_MAX ((unsigned long_long)((long_long)(-1)))
#endif
#ifndef SIZET_MAX
# define SIZET_MAX ((hsize_t)(size_t)(ssize_t)(-1))
# define SSIZET_MAX ((hsize_t)(ssize_t)((size_t)1<<(8*sizeof(ssize_t)-1)))
# define SIZET_MAX ((size_t)(ssize_t)(-1))
# define SSIZET_MAX ((ssize_t)(((size_t)1<<(8*sizeof(ssize_t)-1))-1))
#endif
#ifdef H5_HAVE_LARGE_HSIZET
#define HSIZET_MAX ULLONG_MAX
#define HSSIZET_MAX LLONG_MAX
#define HSIZET_MAX ((hsize_t)ULLONG_MAX)
#define HSSIZET_MAX ((hssize_t)LLONG_MAX)
#else /* H5_HAVE_LARGE_HSIZET */
#define HSIZET_MAX SIZET_MAX
#define HSSIZET_MAX SSIZET_MAX
#define HSIZET_MAX ((hsize_t)SIZET_MAX)
#define HSSIZET_MAX ((hssize_t)SSIZET_MAX)
#endif /* H5_HAVE_LARGE_HSIZET */
#define HSSIZET_MIN (~(HSSIZET_MAX))

View File

@ -47,7 +47,11 @@ const char *FILENAME[] = {
#define TEST_DATATYPE H5T_NATIVE_UCHAR
#define TEST_CHUNK_SIZE 50
#ifdef H5_HAVE_LARGE_HSIZET
#define TEST_SPARSE_SIZE 1000000
#else /* H5_HAVE_LARGE_HSIZET */
#define TEST_SPARSE_SIZE 1200
#endif /* H5_HAVE_LARGE_HSIZET */
hsize_t chunk_dims[H5O_LAYOUT_NDIMS];
hssize_t zero[H5O_LAYOUT_NDIMS];

View File

@ -1195,7 +1195,11 @@ test_file_freespace(void)
/* Check that there is the right amount of free space in the file */
free_space = H5Fget_freespace(file);
CHECK(free_space, FAIL, "H5Fget_freespace");
#ifdef H5_HAVE_LARGE_HSIZET
VERIFY(free_space, 168, "H5Fget_freespace");
#else /* H5_HAVE_LARGE_HSIZET */
VERIFY(free_space, 76, "H5Fget_freespace");
#endif /* H5_HAVE_LARGE_HSIZET */
/* Delete datasets in file */
for(u=0; u<10; u++) {
@ -1207,7 +1211,11 @@ test_file_freespace(void)
/* Check that there is the right amount of free space in the file */
free_space = H5Fget_freespace(file);
CHECK(free_space, FAIL, "H5Fget_freespace");
#ifdef H5_HAVE_LARGE_HSIZET
VERIFY(free_space, 3584, "H5Fget_freespace");
#else /* H5_HAVE_LARGE_HSIZET */
VERIFY(free_space, 3428, "H5Fget_freespace");
#endif /* H5_HAVE_LARGE_HSIZET */
/* Close file */
ret = H5Fclose(file);