Please, help us to better serve our user community by answering the following short survey: https://www.hdfgroup.org/website-survey/
HDF  4.4.0
API Reference
Loading...
Searching...
No Matches
hdftest.h File Reference
#include <float.h>
#include <math.h>
#include <stdio.h>

Macros

#define TESTING(WHAT)
#define PASSED()
#define H4_FAILED()
#define H4_WARNING()
#define SKIPPED()
#define CHECK(status, fail_val, name)
#define CHECK_IND(status, fail_val, name, index)
#define VERIFY(val, x, test_name)
#define VERIFY_FLOAT(val, x, test_name)
#define VERIFY_DOUBLE(val, x, test_name)
#define VERIFY_CHAR(val, x, test_name)
#define CHECK_ALLOC(buffer, buf_name, func_name)
#define H4_FLT_ABS_EQUAL(X, Y)
#define H4_DBL_ABS_EQUAL(X, Y)
#define H4_LDBL_ABS_EQUAL(X, Y)
#define ENDSDS(sds_id, msg)
#define ENDSD(sd_id, msg)

Functions

const char * get_srcdir (void)
const char * get_srcdir_filename (const char *filename)
int make_sourcepath (char *src_path, unsigned int size)
int32 make_SDS (int32 sd_id, const char *sds_name, int32 type, int32 rank, int32 *dim_sizes, int32 unlim_dim, void *written_data)
int32 make_CompSDS (int32 sd_id, char *sds_name, int32 type, int32 rank, int32 *dim_sizes, void *written_data)
int32 make_Ext3D_SDS (int32 sd_id, char *sds_name, int32 type, int32 rank, int32 *dim_sizes, void *written_data, int32 offset, char *ext_file_name)
int32 append_Data2SDS (int32 sd_id, char *sds_name, int32 *start, int32 *edges, void *ap_data)
int verify_datasize (int32 sds_id, int32 data_size, const char *sds_name)
int verify_info_data (int32 sds_id, int32 expected_dimsize, int16 *result)
int32 get_SDSbyName (int32 sd_id, const char *sds_name)

Macro Definition Documentation

◆ CHECK

#define CHECK ( status,
fail_val,
name )
Value:
do { \
if (status == fail_val) { \
fprintf(stderr, "*** Routine %s FAILED at line %d ***\n", name, __LINE__); \
num_errs++; \
goto done; \
} \
} while (0)
intf _fcd name
Definition hproto_fortran.h:762
int num_errs

◆ CHECK_ALLOC

#define CHECK_ALLOC ( buffer,
buf_name,
func_name )
Value:
do { \
if (buffer == NULL) { \
fprintf(stderr, "in %s: space allocation for %s failed. Terminated!\n", func_name, buf_name); \
exit(1); \
} \
} while (0)
intf intf intf intf intf void * buffer
Definition hproto_fortran.h:314

◆ CHECK_IND

#define CHECK_IND ( status,
fail_val,
name,
index )
Value:
do { \
if (status == fail_val) { \
fprintf(stderr, "*** Routine %s FAILED at line %d for SDS index %d ***\n", name, __LINE__, \
index); \
num_errs++; \
goto done; \
} \
} while (0)
HDFFCLIBAPI intf intf * index
Definition mfsdf.h:136

◆ ENDSD

#define ENDSD ( sd_id,
msg )
Value:
do { \
status = SDend(sd_id); \
sd_id = FAIL; \
CHECK(status, FAIL, msg); \
} while (0)
#define FAIL
Definition hdf.h:141
HDFLIBAPI int SDend(int32 fid)

◆ ENDSDS

#define ENDSDS ( sds_id,
msg )
Value:
do { \
status = SDendaccess(sds_id); \
sds_id = FAIL; \
CHECK(status, FAIL, msg); \
} while (0)
HDFLIBAPI int SDendaccess(int32 id)

◆ H4_DBL_ABS_EQUAL

#define H4_DBL_ABS_EQUAL ( X,
Y )
Value:
(fabs((X) - (Y)) < DBL_EPSILON)

◆ H4_FAILED

#define H4_FAILED ( )
Value:
do { \
puts("*FAILED*"); \
fflush(stdout); \
} while (0)

◆ H4_FLT_ABS_EQUAL

#define H4_FLT_ABS_EQUAL ( X,
Y )
Value:
(fabsf((X) - (Y)) < FLT_EPSILON)

◆ H4_LDBL_ABS_EQUAL

#define H4_LDBL_ABS_EQUAL ( X,
Y )
Value:
(fabsl((X) - (Y)) < LDBL_EPSILON)

◆ H4_WARNING

#define H4_WARNING ( )
Value:
do { \
puts("*WARNING*"); \
fflush(stdout); \
} while (0)

◆ PASSED

#define PASSED ( )
Value:
do { \
puts(" PASSED"); \
fflush(stdout); \
} while (0)

◆ SKIPPED

#define SKIPPED ( )
Value:
do { \
puts(" -SKIP-"); \
fflush(stdout); \
} while (0)

◆ TESTING

#define TESTING ( WHAT)
Value:
do { \
printf("Testing %-62s", WHAT); \
fflush(stdout); \
} while (0)

◆ VERIFY

#define VERIFY ( val,
x,
test_name )
Value:
do { \
if (x != val) { \
fprintf(stderr, "*** UNEXPECTED VALUE from %s is %ld (expected %ld) at line %4d in %s\n", \
test_name, (long)val, (long)x, (int)__LINE__, __FILE__); \
num_errs++; \
goto done; \
} \
} while (0)
HDFFCLIBAPI intf _fcd val
Definition mfsdf.h:142

◆ VERIFY_CHAR

#define VERIFY_CHAR ( val,
x,
test_name )
Value:
do { \
if (strcmp(x, val) != 0) { \
fprintf(stderr, "*** UNEXPECTED VALUE from %s is <%s> (expected <%s>) at line %4d in %s\n", \
test_name, val, x, (int)__LINE__, __FILE__); \
num_errs++; \
goto done; \
} \
} while (0)

◆ VERIFY_DOUBLE

#define VERIFY_DOUBLE ( val,
x,
test_name )
Value:
do { \
if (!H4_DBL_ABS_EQUAL(x, val)) { \
fprintf(stderr, "*** UNEXPECTED VALUE from %s is %f (expected %f) at line %4d in %s\n", \
test_name, val, x, (int)__LINE__, __FILE__); \
num_errs++; \
goto done; \
} \
} while (0)
#define H4_DBL_ABS_EQUAL(X, Y)
Definition tutils.h:219

◆ VERIFY_FLOAT

#define VERIFY_FLOAT ( val,
x,
test_name )
Value:
do { \
if (!H4_FLT_ABS_EQUAL(x, val)) { \
fprintf(stderr, "*** UNEXPECTED VALUE from %s is %f (expected %f) at line %4d in %s\n", \
test_name, (double)val, (double)x, (int)__LINE__, __FILE__); \
num_errs++; \
goto done; \
} \
} while (0)
#define H4_FLT_ABS_EQUAL(X, Y)
Definition tutils.h:218

Function Documentation

◆ append_Data2SDS()

int32 append_Data2SDS ( int32 sd_id,
char * sds_name,
int32 * start,
int32 * edges,
void * ap_data )

◆ get_SDSbyName()

int32 get_SDSbyName ( int32 sd_id,
const char * sds_name )

◆ get_srcdir()

const char * get_srcdir ( void )

◆ get_srcdir_filename()

const char * get_srcdir_filename ( const char * filename)

◆ make_CompSDS()

int32 make_CompSDS ( int32 sd_id,
char * sds_name,
int32 type,
int32 rank,
int32 * dim_sizes,
void * written_data )

◆ make_Ext3D_SDS()

int32 make_Ext3D_SDS ( int32 sd_id,
char * sds_name,
int32 type,
int32 rank,
int32 * dim_sizes,
void * written_data,
int32 offset,
char * ext_file_name )

◆ make_SDS()

int32 make_SDS ( int32 sd_id,
const char * sds_name,
int32 type,
int32 rank,
int32 * dim_sizes,
int32 unlim_dim,
void * written_data )

◆ make_sourcepath()

int make_sourcepath ( char * src_path,
unsigned int size )

◆ verify_datasize()

int verify_datasize ( int32 sds_id,
int32 data_size,
const char * sds_name )

◆ verify_info_data()

int verify_info_data ( int32 sds_id,
int32 expected_dimsize,
int16 * result )