From 3f7dc01ccc7f9702c3a4080afe0c2ddebf34c032 Mon Sep 17 00:00:00 2001 From: James Laird Date: Mon, 13 Nov 2006 16:17:41 -0500 Subject: [svn-r12905] Added test/tsohm.c, which was missed in the previous checkin. Oops! --- test/tsohm.c | 296 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 296 insertions(+) create mode 100644 test/tsohm.c diff --git a/test/tsohm.c b/test/tsohm.c new file mode 100644 index 0000000..bf86e19 --- /dev/null +++ b/test/tsohm.c @@ -0,0 +1,296 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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 * + * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*********************************************************** +* +* Test program: tsohm +* +* Test Shared Object Header Messages +* +*************************************************************/ + +#include "testhdf5.h" + +/* Maximum number of SOHM indexes in a file. Should correspond + * to H5SM_MAX_NUM_INDEXES + */ +/* JAMES: get these three from default fcpl */ +#define MAX_INDEXES 6 +/* Default SOHM values */ +#define DEF_NUM_INDEXES 0 +const unsigned def_type_flags[MAX_INDEXES] = {0,0,0,0,0,0}; +#define DEF_L2B 50 +#define DEF_B2L 40 + +/* Non-default SOHM values for testing */ +#define TEST_NUM_INDEXES 4 +const unsigned test_type_flags[MAX_INDEXES] = + {H5SM_FILL_FLAG, + H5SM_DTYPE_FLAG | H5SM_ATTR_FLAG, + H5SM_SDSPACE_FLAG, + H5SM_PLINE_FLAG, + 0, 0}; +#define TEST_L2B 65 +#define TEST_B2L 64 + +#define FILENAME "tsohm.h5" + + +/**************************************************************** +** +** check_fcpl_values(): Helper function for test_sohm_fcpl. +** Verifies that the *_in and *_out parameters are equal. +** +****************************************************************/ +static void check_fcpl_values(hid_t fcpl_id, const unsigned nindexes_in, + const unsigned *flags_in, size_t l2b, size_t b2l) +{ + unsigned num_indexes; + unsigned index_flags[MAX_INDEXES]; + size_t size; + unsigned x; + herr_t ret; + + /* Verify number of indexes is set to default */ + ret = H5Pget_shared_nindexes(fcpl_id, &num_indexes); + CHECK_I(ret, "H5Pget_shared_nindexes"); + VERIFY(num_indexes, nindexes_in, "H5Pget_shared_nindexes"); + + /* Verify index flags are set to default */ + ret = H5Pget_shared_mesg_types(fcpl_id, MAX_INDEXES, index_flags); + CHECK_I(ret, "H5Pget_shared_mesg_types"); + + for(x=0; x