2006-03-25 03:36:44 +08:00
|
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
2007-02-07 22:56:24 +08:00
|
|
|
|
* Copyright by The HDF Group. *
|
2006-03-25 03:36:44 +08:00
|
|
|
|
* Copyright by the Board of Trustees of the University of Illinois. *
|
|
|
|
|
* All rights reserved. *
|
|
|
|
|
* *
|
|
|
|
|
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
|
|
|
|
* terms governing use, modification, and redistribution, is contained in *
|
|
|
|
|
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
|
|
|
|
* of the source code distribution tree; Copyright.html can be found at the *
|
|
|
|
|
* root level of an installed copy of the electronic HDF5 document set and *
|
|
|
|
|
* is linked from the top-level documents page. It can also be found at *
|
2007-02-07 22:56:24 +08:00
|
|
|
|
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
|
|
|
|
* access to either file, you may request a copy from help@hdfgroup.org. *
|
2006-03-25 03:36:44 +08:00
|
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Programmer: Raymond Lu <slu@ncsa.uiuc.edu>
|
|
|
|
|
* Thursday, March 23, 2006
|
|
|
|
|
*
|
2011-05-18 06:18:05 +08:00
|
|
|
|
* Purpose: Check if floating-point data created on big-endian and
|
2011-01-22 04:36:14 +08:00
|
|
|
|
* little-endian machines can be read on the machine running this test.
|
2006-03-25 03:36:44 +08:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "h5test.h"
|
2010-03-18 20:23:04 +08:00
|
|
|
|
#include "H5srcdir.h"
|
2006-03-25 03:36:44 +08:00
|
|
|
|
|
|
|
|
|
const char *FILENAME[] = {
|
|
|
|
|
"vms_data",
|
|
|
|
|
"le_data",
|
|
|
|
|
"be_data",
|
|
|
|
|
NULL
|
|
|
|
|
};
|
|
|
|
|
|
2011-05-18 06:18:05 +08:00
|
|
|
|
#define DATASETNAME "Array_le"
|
|
|
|
|
#define DATASETNAME1 "Array_be"
|
2011-02-02 22:41:49 +08:00
|
|
|
|
#define DATASETNAME2 "Scale_offset_float_data_le"
|
|
|
|
|
#define DATASETNAME3 "Scale_offset_float_data_be"
|
|
|
|
|
#define DATASETNAME4 "Scale_offset_double_data_le"
|
|
|
|
|
#define DATASETNAME5 "Scale_offset_double_data_be"
|
|
|
|
|
#define DATASETNAME6 "Scale_offset_char_data_le"
|
|
|
|
|
#define DATASETNAME7 "Scale_offset_char_data_be"
|
|
|
|
|
#define DATASETNAME8 "Scale_offset_short_data_le"
|
|
|
|
|
#define DATASETNAME9 "Scale_offset_short_data_be"
|
|
|
|
|
#define DATASETNAME10 "Scale_offset_int_data_le"
|
|
|
|
|
#define DATASETNAME11 "Scale_offset_int_data_be"
|
|
|
|
|
#define DATASETNAME12 "Scale_offset_long_long_data_le"
|
|
|
|
|
#define DATASETNAME13 "Scale_offset_long_long_data_be"
|
2011-05-18 06:18:05 +08:00
|
|
|
|
|
|
|
|
|
#define DATASETNAME14 "Fletcher_float_data_le"
|
|
|
|
|
#define DATASETNAME15 "Fletcher_float_data_be"
|
|
|
|
|
#define DATASETNAME16 "Deflate_float_data_le"
|
|
|
|
|
#define DATASETNAME17 "Deflate_float_data_be"
|
2014-03-16 11:13:52 +08:00
|
|
|
|
#ifdef H5_HAVE_FILTER_SZIP
|
2011-05-18 06:18:05 +08:00
|
|
|
|
#define DATASETNAME18 "Szip_float_data_le"
|
|
|
|
|
#define DATASETNAME19 "Szip_float_data_be"
|
2014-03-16 11:13:52 +08:00
|
|
|
|
#endif /* H5_HAVE_FILTER_SZIP */
|
2011-05-18 06:18:05 +08:00
|
|
|
|
#define DATASETNAME20 "Shuffle_float_data_le"
|
|
|
|
|
#define DATASETNAME21 "Shuffle_float_data_be"
|
|
|
|
|
#define DATASETNAME22 "Nbit_float_data_le"
|
|
|
|
|
#define DATASETNAME23 "Nbit_float_data_be"
|
|
|
|
|
|
2011-02-02 22:41:49 +08:00
|
|
|
|
#define NX 6
|
2011-01-22 03:04:14 +08:00
|
|
|
|
#define NY 6
|
2006-03-25 03:36:44 +08:00
|
|
|
|
|
2011-01-22 04:36:14 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2016-06-06 08:45:37 +08:00
|
|
|
|
* Function: check_data_i
|
2011-01-22 04:36:14 +08:00
|
|
|
|
*
|
2016-06-06 08:45:37 +08:00
|
|
|
|
* Purpose: Read and compare the integer data from a dataset.
|
2011-01-22 04:36:14 +08:00
|
|
|
|
*
|
|
|
|
|
* Return: Success: 0
|
2011-05-18 06:18:05 +08:00
|
|
|
|
* Failure: 1
|
2011-01-22 04:36:14 +08:00
|
|
|
|
*
|
|
|
|
|
* Programmer: Raymond Lu
|
2011-05-18 06:18:05 +08:00
|
|
|
|
* 17 May 2011
|
2011-01-22 04:36:14 +08:00
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2016-06-06 08:45:37 +08:00
|
|
|
|
static int
|
|
|
|
|
check_data_i(const char *dsetname, hid_t fid)
|
2006-03-25 03:36:44 +08:00
|
|
|
|
{
|
2016-06-06 08:45:37 +08:00
|
|
|
|
hid_t did = -1; /* dataset ID */
|
|
|
|
|
long long data_in[NX+1][NY]; /* input buffer */
|
|
|
|
|
long long data_out[NX+1][NY]; /* output buffer */
|
|
|
|
|
int i, j; /* iterators */
|
|
|
|
|
int nerrors = 0; /* # errors in dataset values */
|
|
|
|
|
|
|
|
|
|
/* Open the dataset. */
|
|
|
|
|
if((did = H5Dopen2(fid, dsetname, H5P_DEFAULT)) < 0)
|
|
|
|
|
FAIL_STACK_ERROR;
|
|
|
|
|
|
|
|
|
|
/* Initialization. */
|
|
|
|
|
/* Input (last row is different) */
|
|
|
|
|
for(i = 0; i < NX; i++)
|
|
|
|
|
for(j = 0; j < NY; j++)
|
|
|
|
|
data_in[i][j] = i + j;
|
|
|
|
|
for(i = 0; i < NY; i++)
|
|
|
|
|
data_in[NX][i] = -2;
|
|
|
|
|
/* Output */
|
|
|
|
|
HDmemset(data_out, 0, (NX+1) * NY * sizeof(long long));
|
|
|
|
|
|
|
|
|
|
/* Read data from hyperslab in the file into the hyperslab in
|
|
|
|
|
* memory and display.
|
2011-01-22 03:04:14 +08:00
|
|
|
|
*/
|
2016-06-06 08:45:37 +08:00
|
|
|
|
if(H5Dread(did, H5T_NATIVE_LLONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_out) < 0)
|
|
|
|
|
FAIL_STACK_ERROR;
|
|
|
|
|
|
|
|
|
|
/* Check results */
|
|
|
|
|
for(i = 0; i < (NX + 1); i++)
|
|
|
|
|
for(j = 0; j < NY; j++)
|
|
|
|
|
if(data_out[i][j] != data_in[i][j])
|
|
|
|
|
if(!nerrors++) {
|
|
|
|
|
H5_FAILED();
|
|
|
|
|
printf("element [%d][%d] is %lld but should have been %lld\n",
|
|
|
|
|
(int)i, (int)j, data_out[i][j], data_in[i][j]);
|
|
|
|
|
} /* end if */
|
|
|
|
|
|
|
|
|
|
/* Close/release resources. */
|
|
|
|
|
if(H5Dclose(did) < 0)
|
|
|
|
|
FAIL_STACK_ERROR
|
2006-03-25 03:36:44 +08:00
|
|
|
|
|
2016-06-06 08:45:37 +08:00
|
|
|
|
/* Failure */
|
|
|
|
|
if(nerrors) {
|
|
|
|
|
printf("total of %d errors out of %d elements\n", nerrors, (int)(NX*NY));
|
|
|
|
|
return 1;
|
|
|
|
|
} /* end if */
|
|
|
|
|
|
|
|
|
|
PASSED();
|
|
|
|
|
return 0;
|
2011-05-18 06:18:05 +08:00
|
|
|
|
|
2016-06-06 08:45:37 +08:00
|
|
|
|
error:
|
|
|
|
|
H5E_BEGIN_TRY {
|
|
|
|
|
H5Dclose(did);
|
|
|
|
|
} H5E_END_TRY;
|
|
|
|
|
return 1;
|
|
|
|
|
} /* end check_data_i() */
|
2006-03-25 03:36:44 +08:00
|
|
|
|
|
2016-06-06 08:45:37 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: check_data_f
|
|
|
|
|
*
|
|
|
|
|
* Purpose: Read and compare the floating-point data from a dataset.
|
|
|
|
|
*
|
|
|
|
|
* Return: Success: 0
|
|
|
|
|
* Failure: 1
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Raymond Lu
|
|
|
|
|
* 17 May 2011
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
static int
|
|
|
|
|
check_data_f(const char *dsetname, hid_t fid)
|
|
|
|
|
{
|
|
|
|
|
hid_t did = -1; /* dataset ID */
|
|
|
|
|
double data_in[NX+1][NY]; /* input buffer */
|
|
|
|
|
double data_out[NX+1][NY]; /* output buffer */
|
|
|
|
|
int i, j; /* iterators */
|
|
|
|
|
int nerrors = 0; /* # of errors in dataset values */
|
|
|
|
|
|
|
|
|
|
/* Open the dataset. */
|
|
|
|
|
if((did = H5Dopen2(fid, dsetname, H5P_DEFAULT)) < 0)
|
|
|
|
|
FAIL_STACK_ERROR;
|
|
|
|
|
|
|
|
|
|
/* Initialization. */
|
|
|
|
|
/* Input (last row is different) */
|
|
|
|
|
for(i = 0; i < NX; i++)
|
|
|
|
|
for(j = 0; j < NY; j++)
|
|
|
|
|
data_in[i][j] = ((double)(i + j + 1)) / (double)3.0F;
|
|
|
|
|
for(i = 0; i < NY; i++)
|
|
|
|
|
data_in[NX][i] = -2.2F;
|
|
|
|
|
/* Output */
|
|
|
|
|
HDmemset(data_out, 0, (NX+1) * NY * sizeof(double));
|
|
|
|
|
|
|
|
|
|
/* Read data from hyperslab in the file into the hyperslab in
|
2011-02-02 22:41:49 +08:00
|
|
|
|
* memory and display.
|
2006-03-25 03:36:44 +08:00
|
|
|
|
*/
|
2016-06-06 08:45:37 +08:00
|
|
|
|
if(H5Dread(did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_out) < 0)
|
|
|
|
|
FAIL_STACK_ERROR;
|
|
|
|
|
|
|
|
|
|
/* Check results */
|
|
|
|
|
for(i = 0; i < (NX + 1); i++)
|
|
|
|
|
for(j = 0; j < NY; j++)
|
|
|
|
|
if(!H5_DBL_REL_EQUAL(data_out[i][j], data_in[i][j], (double)0.001F))
|
|
|
|
|
if(!nerrors++) {
|
|
|
|
|
H5_FAILED();
|
|
|
|
|
printf("element [%d][%d] is %g but should have been %g\n",
|
|
|
|
|
(int)i, (int)j, data_out[i][j], data_in[i][j]);
|
|
|
|
|
} /* end if */
|
|
|
|
|
|
|
|
|
|
/* Close/release resources. */
|
|
|
|
|
if(H5Dclose(did) < 0)
|
|
|
|
|
FAIL_STACK_ERROR
|
2011-02-02 22:41:49 +08:00
|
|
|
|
|
|
|
|
|
/* Failure */
|
2016-06-06 08:45:37 +08:00
|
|
|
|
if(nerrors) {
|
|
|
|
|
printf("total of %d errors out of %d elements\n", nerrors, (int)(NX*NY));
|
2011-02-02 22:41:49 +08:00
|
|
|
|
return 1;
|
2016-06-06 08:45:37 +08:00
|
|
|
|
} /* end if */
|
2011-02-02 22:41:49 +08:00
|
|
|
|
|
|
|
|
|
PASSED();
|
2011-05-18 06:18:05 +08:00
|
|
|
|
return 0;
|
2011-02-02 22:41:49 +08:00
|
|
|
|
|
2011-05-18 06:18:05 +08:00
|
|
|
|
error:
|
|
|
|
|
H5E_BEGIN_TRY {
|
2016-06-06 08:45:37 +08:00
|
|
|
|
H5Dclose(did);
|
2011-05-18 06:18:05 +08:00
|
|
|
|
} H5E_END_TRY;
|
|
|
|
|
return 1;
|
2016-06-06 08:45:37 +08:00
|
|
|
|
} /* end check_data_f() */
|
2011-01-22 03:04:14 +08:00
|
|
|
|
|
2011-05-18 06:18:05 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2016-06-06 08:45:37 +08:00
|
|
|
|
* Function: check_file
|
2011-05-18 06:18:05 +08:00
|
|
|
|
*
|
|
|
|
|
* Purpose: Handle each dataset from the data file.
|
|
|
|
|
*
|
|
|
|
|
* Return: Success: 0
|
|
|
|
|
* Failure: Number of failures
|
|
|
|
|
*
|
|
|
|
|
* Programmer: Raymond Lu
|
|
|
|
|
* 21 January 2011
|
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2016-06-06 08:45:37 +08:00
|
|
|
|
static int
|
|
|
|
|
check_file(char *filename)
|
2011-05-18 06:18:05 +08:00
|
|
|
|
{
|
2016-06-06 08:45:37 +08:00
|
|
|
|
const char *pathname = H5_get_srcdir_filename(filename); /* Corrected test file name */
|
|
|
|
|
hid_t fid = -1; /* file ID */
|
|
|
|
|
int nerrors = 0; /* # of datasets with errors */
|
|
|
|
|
const char *not_supported= " filter is not enabled."; /* no filter message */
|
2011-02-02 22:41:49 +08:00
|
|
|
|
|
2016-06-06 08:45:37 +08:00
|
|
|
|
/* Open the file. */
|
|
|
|
|
if((fid = H5Fopen(pathname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
|
|
|
|
|
FAIL_STACK_ERROR;
|
2011-01-22 03:04:14 +08:00
|
|
|
|
|
2011-05-18 06:18:05 +08:00
|
|
|
|
TESTING("regular dataset of LE DOUBLE");
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_f(DATASETNAME, fid);
|
2011-01-22 03:04:14 +08:00
|
|
|
|
|
2011-05-18 06:18:05 +08:00
|
|
|
|
TESTING("regular dataset of BE DOUBLE");
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_f(DATASETNAME1, fid);
|
2011-01-22 03:04:14 +08:00
|
|
|
|
|
2011-05-18 06:18:05 +08:00
|
|
|
|
TESTING("dataset of LE FLOAT with scale-offset filter");
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_f(DATASETNAME2, fid);
|
2011-05-18 06:18:05 +08:00
|
|
|
|
|
2011-02-02 22:41:49 +08:00
|
|
|
|
TESTING("dataset of BE FLOAT with scale-offset filter");
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_f(DATASETNAME3, fid);
|
2011-02-02 22:41:49 +08:00
|
|
|
|
|
|
|
|
|
TESTING("dataset of LE DOUBLE with scale-offset filter");
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_f(DATASETNAME4, fid);
|
2011-05-18 06:18:05 +08:00
|
|
|
|
|
2011-02-02 22:41:49 +08:00
|
|
|
|
TESTING("dataset of BE DOUBLE with scale-offset filter");
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_f(DATASETNAME5, fid);
|
2011-05-18 06:18:05 +08:00
|
|
|
|
|
2011-02-02 22:41:49 +08:00
|
|
|
|
TESTING("dataset of LE CHAR with scale-offset filter");
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_i(DATASETNAME6, fid);
|
2011-05-18 06:18:05 +08:00
|
|
|
|
|
2011-02-02 22:41:49 +08:00
|
|
|
|
TESTING("dataset of BE CHAR with scale-offset filter");
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_i(DATASETNAME7, fid);
|
2011-05-18 06:18:05 +08:00
|
|
|
|
|
2011-02-02 22:41:49 +08:00
|
|
|
|
TESTING("dataset of LE SHORT with scale-offset filter");
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_i(DATASETNAME8, fid);
|
2011-05-18 06:18:05 +08:00
|
|
|
|
|
2011-02-02 22:41:49 +08:00
|
|
|
|
TESTING("dataset of BE SHORT with scale-offset filter");
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_i(DATASETNAME9, fid);
|
2011-02-02 22:41:49 +08:00
|
|
|
|
|
|
|
|
|
TESTING("dataset of LE INT with scale-offset filter");
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_i(DATASETNAME10, fid);
|
2011-05-18 06:18:05 +08:00
|
|
|
|
|
2011-02-02 22:41:49 +08:00
|
|
|
|
TESTING("dataset of BE INT with scale-offset filter");
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_i(DATASETNAME11, fid);
|
2011-02-02 22:41:49 +08:00
|
|
|
|
|
|
|
|
|
TESTING("dataset of LE LONG LONG with scale-offset filter");
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_i(DATASETNAME12, fid);
|
2011-05-18 06:18:05 +08:00
|
|
|
|
|
2011-02-02 22:41:49 +08:00
|
|
|
|
TESTING("dataset of BE LONG LONG with scale-offset filter");
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_i(DATASETNAME13, fid);
|
2011-01-22 04:36:14 +08:00
|
|
|
|
|
2011-05-18 06:18:05 +08:00
|
|
|
|
TESTING("dataset of LE FLOAT with Fletcher32 filter");
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_f(DATASETNAME14, fid);
|
2011-05-18 06:18:05 +08:00
|
|
|
|
|
|
|
|
|
TESTING("dataset of BE FLOAT with Fletcher32 filter");
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_f(DATASETNAME15, fid);
|
2011-05-18 06:18:05 +08:00
|
|
|
|
|
|
|
|
|
TESTING("dataset of LE FLOAT with Deflate filter");
|
|
|
|
|
#ifdef H5_HAVE_FILTER_DEFLATE
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_f(DATASETNAME16, fid);
|
2011-05-18 06:18:05 +08:00
|
|
|
|
#else /*H5_HAVE_FILTER_DEFLATE*/
|
|
|
|
|
SKIPPED();
|
2016-06-06 08:45:37 +08:00
|
|
|
|
HDputs(not_supported);
|
2011-05-18 06:18:05 +08:00
|
|
|
|
#endif /*H5_HAVE_FILTER_DEFLATE*/
|
2011-02-02 22:41:49 +08:00
|
|
|
|
|
2011-05-18 06:18:05 +08:00
|
|
|
|
TESTING("dataset of BE FLOAT with Deflate filter");
|
|
|
|
|
#ifdef H5_HAVE_FILTER_DEFLATE
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_f(DATASETNAME17, fid);
|
2011-05-18 06:18:05 +08:00
|
|
|
|
#else /*H5_HAVE_FILTER_DEFLATE*/
|
|
|
|
|
SKIPPED();
|
2016-06-06 08:45:37 +08:00
|
|
|
|
HDputs(not_supported);
|
2011-05-18 06:18:05 +08:00
|
|
|
|
#endif /*H5_HAVE_FILTER_DEFLATE*/
|
2011-01-22 04:36:14 +08:00
|
|
|
|
|
2011-05-18 06:18:05 +08:00
|
|
|
|
TESTING("dataset of LE FLOAT with Szip filter");
|
|
|
|
|
#ifdef H5_HAVE_FILTER_SZIP
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_f(DATASETNAME18, fid);
|
2011-05-18 06:18:05 +08:00
|
|
|
|
#else /*H5_HAVE_FILTER_SZIP*/
|
|
|
|
|
SKIPPED();
|
2016-06-06 08:45:37 +08:00
|
|
|
|
HDputs(not_supported);
|
2011-05-18 06:18:05 +08:00
|
|
|
|
#endif /*H5_HAVE_FILTER_SZIP*/
|
2011-01-22 04:36:14 +08:00
|
|
|
|
|
2011-05-18 06:18:05 +08:00
|
|
|
|
TESTING("dataset of BE FLOAT with Szip filter");
|
|
|
|
|
#ifdef H5_HAVE_FILTER_SZIP
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_f(DATASETNAME19, fid);
|
2011-05-18 06:18:05 +08:00
|
|
|
|
#else /*H5_HAVE_FILTER_SZIP*/
|
|
|
|
|
SKIPPED();
|
2016-06-06 08:45:37 +08:00
|
|
|
|
HDputs(not_supported);
|
2011-05-18 06:18:05 +08:00
|
|
|
|
#endif /*H5_HAVE_FILTER_SZIP*/
|
2011-01-22 04:36:14 +08:00
|
|
|
|
|
2011-05-18 06:18:05 +08:00
|
|
|
|
TESTING("dataset of LE FLOAT with Shuffle filter");
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_f(DATASETNAME20, fid);
|
2011-01-22 04:36:14 +08:00
|
|
|
|
|
2011-05-18 06:18:05 +08:00
|
|
|
|
TESTING("dataset of BE FLOAT with Shuffle filter");
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_f(DATASETNAME21, fid);
|
2011-01-22 04:36:14 +08:00
|
|
|
|
|
2011-05-18 06:18:05 +08:00
|
|
|
|
TESTING("dataset of LE FLOAT with Nbit filter");
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_f(DATASETNAME22, fid);
|
2011-05-18 06:18:05 +08:00
|
|
|
|
|
|
|
|
|
TESTING("dataset of BE FLOAT with Nbit filter");
|
2016-06-06 08:45:37 +08:00
|
|
|
|
nerrors += check_data_f(DATASETNAME23, fid);
|
2011-01-22 03:04:14 +08:00
|
|
|
|
|
2016-06-06 08:45:37 +08:00
|
|
|
|
if(H5Fclose(fid))
|
|
|
|
|
FAIL_STACK_ERROR
|
|
|
|
|
return nerrors;
|
2006-03-25 03:36:44 +08:00
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
|
H5E_BEGIN_TRY {
|
2016-06-06 08:45:37 +08:00
|
|
|
|
H5Fclose(fid);
|
2006-03-25 03:36:44 +08:00
|
|
|
|
} H5E_END_TRY;
|
2011-05-18 06:18:05 +08:00
|
|
|
|
return nerrors;
|
2016-06-06 08:45:37 +08:00
|
|
|
|
} /* end check_file() */
|
2006-03-25 03:36:44 +08:00
|
|
|
|
|
2011-01-22 03:04:14 +08:00
|
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
|
* Function: main
|
|
|
|
|
*
|
2011-05-18 06:18:05 +08:00
|
|
|
|
* Purpose: Tests reading files created on LE and BE systems.
|
2011-01-22 03:04:14 +08:00
|
|
|
|
*
|
2016-06-06 08:45:37 +08:00
|
|
|
|
* Return: EXIT_SUCCESS/EXIT_FAILURE
|
2011-01-22 03:04:14 +08:00
|
|
|
|
*
|
|
|
|
|
* Programmer: Raymond Lu
|
2011-05-18 06:18:05 +08:00
|
|
|
|
* Thursday, March 23, 2006
|
2011-01-22 03:04:14 +08:00
|
|
|
|
*
|
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
|
*/
|
2016-06-06 08:45:37 +08:00
|
|
|
|
int
|
|
|
|
|
main(void)
|
2006-03-25 03:36:44 +08:00
|
|
|
|
{
|
|
|
|
|
char filename[1024];
|
2016-06-06 08:45:37 +08:00
|
|
|
|
int nerrors = 0;
|
2006-03-25 03:36:44 +08:00
|
|
|
|
|
|
|
|
|
h5_reset();
|
|
|
|
|
|
2016-06-06 08:45:37 +08:00
|
|
|
|
HDputs("\n");
|
|
|
|
|
HDputs("Testing reading data created on Linux");
|
|
|
|
|
h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename));
|
|
|
|
|
nerrors += check_file(filename);
|
2006-03-25 03:36:44 +08:00
|
|
|
|
|
2016-06-06 08:45:37 +08:00
|
|
|
|
HDputs("\n");
|
|
|
|
|
HDputs("Testing reading data created on Solaris");
|
|
|
|
|
h5_fixname(FILENAME[2], H5P_DEFAULT, filename, sizeof(filename));
|
|
|
|
|
nerrors += check_file(filename);
|
2006-03-25 03:36:44 +08:00
|
|
|
|
|
2016-06-06 08:45:37 +08:00
|
|
|
|
if(nerrors) {
|
|
|
|
|
printf("***** %d FAILURE%s! *****\n", nerrors, 1 == nerrors ? "" : "S");
|
|
|
|
|
return EXIT_FAILURE;
|
|
|
|
|
} /* end if */
|
2006-03-25 03:36:44 +08:00
|
|
|
|
|
|
|
|
|
printf("All data type tests passed.\n");
|
2016-06-06 08:45:37 +08:00
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
|
} /* end main() */
|
|
|
|
|
|