From b487ccb9ee03bc584c820890755bbd4ef2efd0c6 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 11 Jun 1999 17:06:26 -0500 Subject: [svn-r1334] VL datatype testing file. Currently, only atomic datatype sequences are tested, but I expect the others to work correctly also. More tests on VL compound and VL VL (atomic) types forthcoming. --- test/tvltypes.c | 168 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 test/tvltypes.c diff --git a/test/tvltypes.c b/test/tvltypes.c new file mode 100644 index 0000000..22f490b --- /dev/null +++ b/test/tvltypes.c @@ -0,0 +1,168 @@ +/**************************************************************************** + * NCSA HDF * + * Software Development Group * + * National Center for Supercomputing Applications * + * University of Illinois at Urbana-Champaign * + * 605 E. Springfield, Champaign IL 61820 * + * * + * For conditions of distribution and use, see the accompanying * + * hdf/COPYING file. * + * * + ****************************************************************************/ + +#ifdef RCSID +static char RcsId[] = "$Revision$"; +#endif + +/* $Id$ */ + +/*********************************************************** +* +* Test program: tvltypes +* +* Test the Variable-Length Datatype functionality +* +*************************************************************/ + +#include + +#include + +#define FILE "tvltypes.h5" + +/* 1-D dataset with fixed dimensions */ +#define SPACE1_NAME "Space1" +#define SPACE1_RANK 1 +#define SPACE1_DIM1 4 + +/* 2-D dataset with fixed dimensions */ +#define SPACE2_NAME "Space2" +#define SPACE2_RANK 2 +#define SPACE2_DIM1 10 +#define SPACE2_DIM2 10 + +/**************************************************************** +** +** test_vltypes_atomic(): Test basic VL datatype code. +** Tests VL datatypes of atomic datatypes +** +****************************************************************/ +static void +test_vltypes_atomic(void) +{ + hvl_t wdata[SPACE1_DIM1]; /* Information to write */ + hvl_t rdata[SPACE1_DIM1]; /* Information read in */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Datatype ID */ + hsize_t dims1[] = {SPACE1_DIM1}; + uintn i,j; /* counting variables */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(5, ("Testing Basic VL Datatype Functionality\n")); + + /* Allocate and initialize VL data to write */ + for(i=0; i