diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2009-04-09 19:56:54 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2009-04-09 19:56:54 (GMT) |
commit | c8f6207556a42f2408eb075d5c037699751fef8d (patch) | |
tree | 0e1c929e392902c99a9d95acca87d087c1aa0b62 /hl/test/test_lite.c | |
parent | 16985151d7332580d8100187b757b107c323a063 (diff) | |
download | hdf5-c8f6207556a42f2408eb075d5c037699751fef8d.zip hdf5-c8f6207556a42f2408eb075d5c037699751fef8d.tar.gz hdf5-c8f6207556a42f2408eb075d5c037699751fef8d.tar.bz2 |
[svn-r16719] clean linux warnings
tested: linux
Diffstat (limited to 'hl/test/test_lite.c')
-rw-r--r-- | hl/test/test_lite.c | 1483 |
1 files changed, 740 insertions, 743 deletions
diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index 239ad60..6de2e31 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -1,17 +1,17 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Copyright by The HDF Group. * - * 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://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +* Copyright by The HDF Group. * +* 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://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * +* access to either file, you may request a copy from help@hdfgroup.org. * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include <stdlib.h> #include <string.h> @@ -45,358 +45,355 @@ #define ATTR10_NAME "attr float" #define ATTR11_NAME "attr double" -/*Initial input buffer size for testing H5LTtext_to_dtype()*/ -#define BUF_SIZE 1024 - static herr_t make_attributes( hid_t loc_id, const char* obj_name ); /*------------------------------------------------------------------------- - * test dataset functions - *------------------------------------------------------------------------- - */ +* test dataset functions +*------------------------------------------------------------------------- +*/ static int test_dsets( void ) { - int rank = 2; - hsize_t dims[2] = {2,3}; - hid_t file_id; - hid_t dataset_id; - char data_char_in[DIM] = {1,2,3,4,5,6}; - char data_char_out[DIM]; - short data_short_in[DIM] = {1,2,3,4,5,6}; - short data_short_out[DIM]; - int data_int_in[DIM] = {1,2,3,4,5,6}; - int data_int_out[DIM]; - long data_long_in[DIM] = {1,2,3,4,5,6}; - long data_long_out[DIM]; - float data_float_in[DIM] = {1,2,3,4,5,6}; - float data_float_out[DIM]; - double data_double_in[DIM] = {1,2,3,4,5,6}; - double data_double_out[DIM]; - const char *data_string_in = "This is a string"; - char data_string_out[20]; - int i; - - - /* Create a new file using default properties. */ - file_id = H5Fcreate( FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT ); + int rank = 2; + hsize_t dims[2] = {2,3}; + hid_t file_id; + hid_t dataset_id; + char data_char_in[DIM] = {1,2,3,4,5,6}; + char data_char_out[DIM]; + short data_short_in[DIM] = {1,2,3,4,5,6}; + short data_short_out[DIM]; + int data_int_in[DIM] = {1,2,3,4,5,6}; + int data_int_out[DIM]; + long data_long_in[DIM] = {1,2,3,4,5,6}; + long data_long_out[DIM]; + float data_float_in[DIM] = {1,2,3,4,5,6}; + float data_float_out[DIM]; + double data_double_in[DIM] = {1,2,3,4,5,6}; + double data_double_out[DIM]; + const char *data_string_in = "This is a string"; + char data_string_out[20]; + int i; -/*------------------------------------------------------------------------- - * H5LTmake_dataset test - *------------------------------------------------------------------------- - */ - TESTING("H5LTmake_dataset"); + /* Create a new file using default properties. */ + file_id = H5Fcreate( FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT ); - /* Make dataset */ - if ( H5LTmake_dataset( file_id, DSET0_NAME, rank, dims, H5T_NATIVE_INT, data_int_in ) < 0 ) - goto out; + /*------------------------------------------------------------------------- + * H5LTmake_dataset test + *------------------------------------------------------------------------- + */ - /* Read dataset using the basic HDF5 API */ + TESTING("H5LTmake_dataset"); - if ( ( dataset_id = H5Dopen2(file_id, DSET0_NAME, H5P_DEFAULT) ) < 0 ) - goto out; + /* Make dataset */ + if ( H5LTmake_dataset( file_id, DSET0_NAME, rank, dims, H5T_NATIVE_INT, data_int_in ) < 0 ) + goto out; - if ( H5Dread ( dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_int_out ) < 0 ) - goto out; + /* Read dataset using the basic HDF5 API */ - if ( H5Dclose( dataset_id ) < 0 ) - goto out; + if ( ( dataset_id = H5Dopen2(file_id, DSET0_NAME, H5P_DEFAULT) ) < 0 ) + goto out; - for (i = 0; i < DIM; i++) - { - if ( data_int_in[i] != data_int_out[i] ) { - goto out; - } - } + if ( H5Dread ( dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_int_out ) < 0 ) + goto out; - PASSED(); + if ( H5Dclose( dataset_id ) < 0 ) + goto out; -/*------------------------------------------------------------------------- - * read using the LT function H5LTread_dataset - *------------------------------------------------------------------------- - */ + for (i = 0; i < DIM; i++) + { + if ( data_int_in[i] != data_int_out[i] ) { + goto out; + } + } - TESTING("H5LTread_dataset"); + PASSED(); - if ( H5LTread_dataset( file_id, DSET0_NAME, H5T_NATIVE_INT, data_int_out ) < 0 ) - goto out; + /*------------------------------------------------------------------------- + * read using the LT function H5LTread_dataset + *------------------------------------------------------------------------- + */ - for (i = 0; i < DIM; i++) - { - if ( data_int_in[i] != data_int_out[i] ) { - goto out; - } - } + TESTING("H5LTread_dataset"); - PASSED(); + if ( H5LTread_dataset( file_id, DSET0_NAME, H5T_NATIVE_INT, data_int_out ) < 0 ) + goto out; -/*------------------------------------------------------------------------- - * test the H5LTmake_dataset_ functions - *------------------------------------------------------------------------- - */ + for (i = 0; i < DIM; i++) + { + if ( data_int_in[i] != data_int_out[i] ) { + goto out; + } + } + PASSED(); -/*------------------------------------------------------------------------- - * H5LTmake_dataset_char - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * test the H5LTmake_dataset_ functions + *------------------------------------------------------------------------- + */ - TESTING("H5LTmake_dataset_char"); - /* Make dataset char */ - if ( H5LTmake_dataset_char( file_id, DSET1_NAME, rank, dims, data_char_in ) < 0 ) - goto out; + /*------------------------------------------------------------------------- + * H5LTmake_dataset_char + *------------------------------------------------------------------------- + */ - /* Read dataset */ - if ( H5LTread_dataset( file_id, DSET1_NAME, H5T_NATIVE_CHAR, data_char_out ) < 0 ) - goto out; + TESTING("H5LTmake_dataset_char"); - for (i = 0; i < DIM; i++) - { - if ( data_char_in[i] != data_char_out[i] ) { - goto out; - } - } + /* Make dataset char */ + if ( H5LTmake_dataset_char( file_id, DSET1_NAME, rank, dims, data_char_in ) < 0 ) + goto out; + + /* Read dataset */ + if ( H5LTread_dataset( file_id, DSET1_NAME, H5T_NATIVE_CHAR, data_char_out ) < 0 ) + goto out; - /* Read dataset */ - if ( H5LTread_dataset_char( file_id, DSET1_NAME, data_char_out ) < 0 ) - goto out; + for (i = 0; i < DIM; i++) + { + if ( data_char_in[i] != data_char_out[i] ) { + goto out; + } + } - for (i = 0; i < DIM; i++) - { - if ( data_char_in[i] != data_char_out[i] ) { - goto out; - } - } + /* Read dataset */ + if ( H5LTread_dataset_char( file_id, DSET1_NAME, data_char_out ) < 0 ) + goto out; - PASSED(); + for (i = 0; i < DIM; i++) + { + if ( data_char_in[i] != data_char_out[i] ) { + goto out; + } + } + PASSED(); -/*------------------------------------------------------------------------- - * H5LTmake_dataset_short - *------------------------------------------------------------------------- - */ - TESTING("H5LTmake_dataset_short"); + /*------------------------------------------------------------------------- + * H5LTmake_dataset_short + *------------------------------------------------------------------------- + */ - /* Make dataset short */ - if ( H5LTmake_dataset_short( file_id, DSET2_NAME, rank, dims, data_short_in ) < 0 ) - goto out; + TESTING("H5LTmake_dataset_short"); - /* Read dataset */ - if ( H5LTread_dataset( file_id, DSET2_NAME, H5T_NATIVE_SHORT, data_short_out ) < 0 ) - goto out; + /* Make dataset short */ + if ( H5LTmake_dataset_short( file_id, DSET2_NAME, rank, dims, data_short_in ) < 0 ) + goto out; - for (i = 0; i < DIM; i++) - { - if ( data_short_in[i] != data_short_out[i] ) { - goto out; - } - } + /* Read dataset */ + if ( H5LTread_dataset( file_id, DSET2_NAME, H5T_NATIVE_SHORT, data_short_out ) < 0 ) + goto out; - /* Read dataset */ - if ( H5LTread_dataset_short( file_id, DSET2_NAME, data_short_out ) < 0 ) - goto out; + for (i = 0; i < DIM; i++) + { + if ( data_short_in[i] != data_short_out[i] ) { + goto out; + } + } - for (i = 0; i < DIM; i++) - { - if ( data_short_in[i] != data_short_out[i] ) { - goto out; - } - } + /* Read dataset */ + if ( H5LTread_dataset_short( file_id, DSET2_NAME, data_short_out ) < 0 ) + goto out; - PASSED(); + for (i = 0; i < DIM; i++) + { + if ( data_short_in[i] != data_short_out[i] ) { + goto out; + } + } -/*------------------------------------------------------------------------- - * H5LTmake_dataset_int - *------------------------------------------------------------------------- - */ + PASSED(); - TESTING("H5LTmake_dataset_int"); + /*------------------------------------------------------------------------- + * H5LTmake_dataset_int + *------------------------------------------------------------------------- + */ - /* Make dataset int */ - if ( H5LTmake_dataset_int( file_id, DSET3_NAME, rank, dims, data_int_in ) < 0 ) - goto out; + TESTING("H5LTmake_dataset_int"); - /* Read dataset */ - if ( H5LTread_dataset( file_id, DSET3_NAME, H5T_NATIVE_INT, data_int_out ) < 0 ) - goto out; + /* Make dataset int */ + if ( H5LTmake_dataset_int( file_id, DSET3_NAME, rank, dims, data_int_in ) < 0 ) + goto out; - for (i = 0; i < DIM; i++) - { - if ( data_int_in[i] != data_int_out[i] ) { - goto out; - } - } + /* Read dataset */ + if ( H5LTread_dataset( file_id, DSET3_NAME, H5T_NATIVE_INT, data_int_out ) < 0 ) + goto out; - /* Read dataset */ - if ( H5LTread_dataset_int( file_id, DSET3_NAME, data_int_out ) < 0 ) - goto out; + for (i = 0; i < DIM; i++) + { + if ( data_int_in[i] != data_int_out[i] ) { + goto out; + } + } - for (i = 0; i < DIM; i++) - { - if ( data_int_in[i] != data_int_out[i] ) { - goto out; - } - } + /* Read dataset */ + if ( H5LTread_dataset_int( file_id, DSET3_NAME, data_int_out ) < 0 ) + goto out; - PASSED(); + for (i = 0; i < DIM; i++) + { + if ( data_int_in[i] != data_int_out[i] ) { + goto out; + } + } + PASSED(); -/*------------------------------------------------------------------------- - * H5LTmake_dataset_long - *------------------------------------------------------------------------- - */ - TESTING("H5LTmake_dataset_long"); + /*------------------------------------------------------------------------- + * H5LTmake_dataset_long + *------------------------------------------------------------------------- + */ - /* Make dataset long */ - if ( H5LTmake_dataset_long( file_id, DSET4_NAME, rank, dims, data_long_in ) < 0 ) - goto out; + TESTING("H5LTmake_dataset_long"); - /* Read dataset */ - if ( H5LTread_dataset( file_id, DSET4_NAME, H5T_NATIVE_LONG, data_long_out ) < 0 ) - goto out; + /* Make dataset long */ + if ( H5LTmake_dataset_long( file_id, DSET4_NAME, rank, dims, data_long_in ) < 0 ) + goto out; - for (i = 0; i < DIM; i++) - { - if ( data_long_in[i] != data_long_out[i] ) { - goto out; - } - } + /* Read dataset */ + if ( H5LTread_dataset( file_id, DSET4_NAME, H5T_NATIVE_LONG, data_long_out ) < 0 ) + goto out; - /* Read dataset */ - if ( H5LTread_dataset_long( file_id, DSET4_NAME, data_long_out ) < 0 ) - goto out; + for (i = 0; i < DIM; i++) + { + if ( data_long_in[i] != data_long_out[i] ) { + goto out; + } + } - for (i = 0; i < DIM; i++) - { - if ( data_long_in[i] != data_long_out[i] ) { - goto out; - } - } + /* Read dataset */ + if ( H5LTread_dataset_long( file_id, DSET4_NAME, data_long_out ) < 0 ) + goto out; - PASSED(); + for (i = 0; i < DIM; i++) + { + if ( data_long_in[i] != data_long_out[i] ) { + goto out; + } + } + PASSED(); -/*------------------------------------------------------------------------- - * H5LTmake_dataset_float - *------------------------------------------------------------------------- - */ - TESTING("H5LTmake_dataset_float"); + /*------------------------------------------------------------------------- + * H5LTmake_dataset_float + *------------------------------------------------------------------------- + */ - /* Make dataset float */ - if ( H5LTmake_dataset_float( file_id, DSET5_NAME, rank, dims, data_float_in ) < 0 ) - goto out; + TESTING("H5LTmake_dataset_float"); - /* Read dataset */ - if ( H5LTread_dataset( file_id, DSET5_NAME, H5T_NATIVE_FLOAT, data_float_out ) < 0 ) - goto out; + /* Make dataset float */ + if ( H5LTmake_dataset_float( file_id, DSET5_NAME, rank, dims, data_float_in ) < 0 ) + goto out; - for (i = 0; i < DIM; i++) - { - if ( data_float_in[i] != data_float_out[i] ) { - goto out; - } - } + /* Read dataset */ + if ( H5LTread_dataset( file_id, DSET5_NAME, H5T_NATIVE_FLOAT, data_float_out ) < 0 ) + goto out; - /* Read dataset */ - if ( H5LTread_dataset_float( file_id, DSET5_NAME, data_float_out ) < 0 ) - goto out; + for (i = 0; i < DIM; i++) + { + if ( data_float_in[i] != data_float_out[i] ) { + goto out; + } + } - for (i = 0; i < DIM; i++) - { - if ( data_float_in[i] != data_float_out[i] ) { - goto out; - } - } + /* Read dataset */ + if ( H5LTread_dataset_float( file_id, DSET5_NAME, data_float_out ) < 0 ) + goto out; - PASSED(); + for (i = 0; i < DIM; i++) + { + if ( data_float_in[i] != data_float_out[i] ) { + goto out; + } + } + PASSED(); -/*------------------------------------------------------------------------- - * H5LTmake_dataset_double - *------------------------------------------------------------------------- - */ - TESTING("H5LTmake_dataset_double"); + /*------------------------------------------------------------------------- + * H5LTmake_dataset_double + *------------------------------------------------------------------------- + */ - /* Make dataset double */ - if ( H5LTmake_dataset_double( file_id, DSET6_NAME, rank, dims, data_double_in ) < 0 ) - goto out; + TESTING("H5LTmake_dataset_double"); - /* Read dataset */ - if ( H5LTread_dataset( file_id, DSET6_NAME, H5T_NATIVE_DOUBLE, data_double_out ) < 0 ) - goto out; + /* Make dataset double */ + if ( H5LTmake_dataset_double( file_id, DSET6_NAME, rank, dims, data_double_in ) < 0 ) + goto out; - for (i = 0; i < DIM; i++) - { - if ( data_double_in[i] != data_double_out[i] ) { - goto out; - } - } + /* Read dataset */ + if ( H5LTread_dataset( file_id, DSET6_NAME, H5T_NATIVE_DOUBLE, data_double_out ) < 0 ) + goto out; - /* Read dataset */ - if ( H5LTread_dataset_double( file_id, DSET6_NAME, data_double_out ) < 0 ) - goto out; + for (i = 0; i < DIM; i++) + { + if ( data_double_in[i] != data_double_out[i] ) { + goto out; + } + } - for (i = 0; i < DIM; i++) - { - if ( data_double_in[i] != data_double_out[i] ) { - goto out; - } - } + /* Read dataset */ + if ( H5LTread_dataset_double( file_id, DSET6_NAME, data_double_out ) < 0 ) + goto out; - PASSED(); + for (i = 0; i < DIM; i++) + { + if ( data_double_in[i] != data_double_out[i] ) { + goto out; + } + } + PASSED(); -/*------------------------------------------------------------------------- - * H5LTmake_dataset_string - *------------------------------------------------------------------------- - */ - TESTING("H5LTmake_dataset_string"); + /*------------------------------------------------------------------------- + * H5LTmake_dataset_string + *------------------------------------------------------------------------- + */ - /* Make dataset string */ - if ( H5LTmake_dataset_string(file_id,DSET7_NAME,data_string_in) < 0 ) - goto out; + TESTING("H5LTmake_dataset_string"); - /* Read dataset */ - if ( H5LTread_dataset_string(file_id,DSET7_NAME,data_string_out) < 0 ) - goto out; + /* Make dataset string */ + if ( H5LTmake_dataset_string(file_id,DSET7_NAME,data_string_in) < 0 ) + goto out; - if ( strcmp(data_string_in,data_string_out) != 0 ) - goto out; + /* Read dataset */ + if ( H5LTread_dataset_string(file_id,DSET7_NAME,data_string_out) < 0 ) + goto out; + if ( strcmp(data_string_in,data_string_out) != 0 ) + goto out; -/*------------------------------------------------------------------------- - * end tests - *------------------------------------------------------------------------- - */ - /* Close the file. */ - H5Fclose( file_id ); + /*------------------------------------------------------------------------- + * end tests + *------------------------------------------------------------------------- + */ + + /* Close the file. */ + H5Fclose( file_id ); - PASSED(); + PASSED(); - return 0; + return 0; out: - /* Close the file. */ - H5_FAILED(); - return -1; + /* Close the file. */ + H5_FAILED(); + return -1; } /*------------------------------------------------------------------------- - * test attribute functions - *------------------------------------------------------------------------- - */ +* test attribute functions +*------------------------------------------------------------------------- +*/ static int test_attr(void) { @@ -477,575 +474,575 @@ out: } /*------------------------------------------------------------------------- - * make_attributes - *------------------------------------------------------------------------- - */ +* make_attributes +*------------------------------------------------------------------------- +*/ static herr_t make_attributes( hid_t loc_id, const char* obj_name ) { - int rank_out; - hsize_t *dims_out = 0; - H5T_class_t type_class; - size_t type_size; - int i; - - char attr_str_in[] = {"My attribute"}; - char attr_str_out[20]; - char attr_char_in[5] = {1,2,3,4,5}; - char attr_char_out[5]; - short attr_short_in[5] = {1,2,3,4,5}; - short attr_short_out[5]; - int attr_int_in[5] = {1,2,3,4,5}; - int attr_int_out[5]; - long attr_long_in[5] = {1,2,3,4,5}; - long attr_long_out[5]; - float attr_float_in[5] = {1,2,3,4,5}; - float attr_float_out[5]; - double attr_double_in[5] = {1,2,3,4,5}; - double attr_double_out[5]; - unsigned char attr_uchar_in[5] = {1,2,3,4,5}; - unsigned char attr_uchar_out[5]; - unsigned short attr_ushort_in[5] = {1,2,3,4,5}; - unsigned short attr_ushort_out[5]; - unsigned int attr_uint_in[5] = {1,2,3,4,5}; - unsigned int attr_uint_out[5]; - unsigned long attr_ulong_in[5] = {1,2,3,4,5}; - unsigned long attr_ulong_out[5]; + int rank_out; + hsize_t *dims_out = 0; + H5T_class_t type_class; + size_t type_size; + int i; + + char attr_str_in[] = {"My attribute"}; + char attr_str_out[20]; + char attr_char_in[5] = {1,2,3,4,5}; + char attr_char_out[5]; + short attr_short_in[5] = {1,2,3,4,5}; + short attr_short_out[5]; + int attr_int_in[5] = {1,2,3,4,5}; + int attr_int_out[5]; + long attr_long_in[5] = {1,2,3,4,5}; + long attr_long_out[5]; + float attr_float_in[5] = {1,2,3,4,5}; + float attr_float_out[5]; + double attr_double_in[5] = {1,2,3,4,5}; + double attr_double_out[5]; + unsigned char attr_uchar_in[5] = {1,2,3,4,5}; + unsigned char attr_uchar_out[5]; + unsigned short attr_ushort_in[5] = {1,2,3,4,5}; + unsigned short attr_ushort_out[5]; + unsigned int attr_uint_in[5] = {1,2,3,4,5}; + unsigned int attr_uint_out[5]; + unsigned long attr_ulong_in[5] = {1,2,3,4,5}; + unsigned long attr_ulong_out[5]; -/*------------------------------------------------------------------------- - * H5LTset_attribute_string test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_string test + *------------------------------------------------------------------------- + */ - TESTING("H5LTset_attribute_string"); + TESTING("H5LTset_attribute_string"); - /* Set the attribute */ - if ( H5LTset_attribute_string( loc_id, obj_name, ATTR1_NAME, attr_str_in ) < 0 ) - return -1; + /* Set the attribute */ + if ( H5LTset_attribute_string( loc_id, obj_name, ATTR1_NAME, attr_str_in ) < 0 ) + return -1; - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTset_attribute_string test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_string test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_string"); + TESTING("H5LTget_attribute_string"); - /* Get the attribute */ - if ( H5LTget_attribute_string( loc_id, obj_name, ATTR1_NAME, attr_str_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute_string( loc_id, obj_name, ATTR1_NAME, attr_str_out ) < 0 ) + return -1; - if ( strcmp( attr_str_in, attr_str_out ) != 0 ) - { - return -1; - } + if ( strcmp( attr_str_in, attr_str_out ) != 0 ) + { + return -1; + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTset_attribute_char test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_char test + *------------------------------------------------------------------------- + */ - TESTING("H5LTset_attribute_char"); + TESTING("H5LTset_attribute_char"); - /* Set the attribute */ - if ( H5LTset_attribute_char( loc_id, obj_name, ATTR2_NAME, attr_char_in, (size_t)5 ) < 0 ) - return -1; + /* Set the attribute */ + if ( H5LTset_attribute_char( loc_id, obj_name, ATTR2_NAME, attr_char_in, (size_t)5 ) < 0 ) + return -1; - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_char test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_char test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_char"); + TESTING("H5LTget_attribute_char"); - /* Get the attribute */ - if ( H5LTget_attribute_char( loc_id, obj_name, ATTR2_NAME, attr_char_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute_char( loc_id, obj_name, ATTR2_NAME, attr_char_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_char_in[i] != attr_char_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_char_in[i] != attr_char_out[i] ) { + return -1; + } + } - /* Get the attribute */ - if ( H5LTget_attribute( loc_id, obj_name, ATTR2_NAME, H5T_NATIVE_CHAR, attr_char_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute( loc_id, obj_name, ATTR2_NAME, H5T_NATIVE_CHAR, attr_char_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_char_in[i] != attr_char_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_char_in[i] != attr_char_out[i] ) { + return -1; + } + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTset_attribute_short test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_short test + *------------------------------------------------------------------------- + */ - TESTING("H5LTset_attribute_short"); + TESTING("H5LTset_attribute_short"); - /* Set the attribute */ - if ( H5LTset_attribute_short( loc_id, obj_name, ATTR3_NAME, attr_short_in, (size_t)5 ) < 0 ) - return -1; + /* Set the attribute */ + if ( H5LTset_attribute_short( loc_id, obj_name, ATTR3_NAME, attr_short_in, (size_t)5 ) < 0 ) + return -1; - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_short test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_short test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_short"); + TESTING("H5LTget_attribute_short"); - /* Get the attribute */ - if ( H5LTget_attribute_short( loc_id, obj_name, ATTR3_NAME, attr_short_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute_short( loc_id, obj_name, ATTR3_NAME, attr_short_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_short_in[i] != attr_short_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_short_in[i] != attr_short_out[i] ) { + return -1; + } + } - /* Get the attribute */ - if ( H5LTget_attribute( loc_id, obj_name, ATTR3_NAME, H5T_NATIVE_SHORT, attr_short_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute( loc_id, obj_name, ATTR3_NAME, H5T_NATIVE_SHORT, attr_short_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_short_in[i] != attr_short_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_short_in[i] != attr_short_out[i] ) { + return -1; + } + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTset_attribute_int test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_int test + *------------------------------------------------------------------------- + */ - TESTING("H5LTset_attribute_int"); + TESTING("H5LTset_attribute_int"); - /* Set the attribute */ - if ( H5LTset_attribute_int( loc_id, obj_name, ATTR4_NAME, attr_int_in, (size_t)5 ) < 0 ) - return -1; + /* Set the attribute */ + if ( H5LTset_attribute_int( loc_id, obj_name, ATTR4_NAME, attr_int_in, (size_t)5 ) < 0 ) + return -1; - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_int test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_int test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_int"); + TESTING("H5LTget_attribute_int"); - /* Get the attribute */ - if ( H5LTget_attribute_int( loc_id, obj_name, ATTR4_NAME, attr_int_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute_int( loc_id, obj_name, ATTR4_NAME, attr_int_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_int_in[i] != attr_int_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_int_in[i] != attr_int_out[i] ) { + return -1; + } + } - /* Get the attribute */ - if ( H5LTget_attribute( loc_id, obj_name, ATTR4_NAME, H5T_NATIVE_INT, attr_int_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute( loc_id, obj_name, ATTR4_NAME, H5T_NATIVE_INT, attr_int_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_int_in[i] != attr_int_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_int_in[i] != attr_int_out[i] ) { + return -1; + } + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTset_attribute_long test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_long test + *------------------------------------------------------------------------- + */ - TESTING("H5LTset_attribute_long"); + TESTING("H5LTset_attribute_long"); - /* Set the attribute */ - if ( H5LTset_attribute_long( loc_id, obj_name, ATTR5_NAME, attr_long_in, (size_t)5 ) < 0 ) - return -1; + /* Set the attribute */ + if ( H5LTset_attribute_long( loc_id, obj_name, ATTR5_NAME, attr_long_in, (size_t)5 ) < 0 ) + return -1; - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_long test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_long test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_long"); + TESTING("H5LTget_attribute_long"); - /* Get the attribute */ - if ( H5LTget_attribute_long( loc_id, obj_name, ATTR5_NAME, attr_long_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute_long( loc_id, obj_name, ATTR5_NAME, attr_long_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_long_in[i] != attr_long_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_long_in[i] != attr_long_out[i] ) { + return -1; + } + } - /* Get the attribute */ - if ( H5LTget_attribute( loc_id, obj_name, ATTR5_NAME, H5T_NATIVE_LONG, attr_long_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute( loc_id, obj_name, ATTR5_NAME, H5T_NATIVE_LONG, attr_long_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_long_in[i] != attr_long_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_long_in[i] != attr_long_out[i] ) { + return -1; + } + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTset_attribute_uchar test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_uchar test + *------------------------------------------------------------------------- + */ - TESTING("H5LTset_attribute_uchar"); + TESTING("H5LTset_attribute_uchar"); - /* Set the attribute */ - if ( H5LTset_attribute_uchar( loc_id, obj_name, ATTR6_NAME, attr_uchar_in, (size_t)5 ) < 0 ) - return -1; + /* Set the attribute */ + if ( H5LTset_attribute_uchar( loc_id, obj_name, ATTR6_NAME, attr_uchar_in, (size_t)5 ) < 0 ) + return -1; - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_uchar test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_uchar test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_uchar"); + TESTING("H5LTget_attribute_uchar"); - /* Get the attribute */ - if ( H5LTget_attribute_uchar( loc_id, obj_name, ATTR6_NAME, attr_uchar_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute_uchar( loc_id, obj_name, ATTR6_NAME, attr_uchar_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_uchar_in[i] != attr_uchar_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_uchar_in[i] != attr_uchar_out[i] ) { + return -1; + } + } - /* Get the attribute */ - if ( H5LTget_attribute( loc_id, obj_name, ATTR6_NAME, H5T_NATIVE_UCHAR, attr_uchar_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute( loc_id, obj_name, ATTR6_NAME, H5T_NATIVE_UCHAR, attr_uchar_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_uchar_in[i] != attr_uchar_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_uchar_in[i] != attr_uchar_out[i] ) { + return -1; + } + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTset_attribute_ushort test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_ushort test + *------------------------------------------------------------------------- + */ - TESTING("H5LTset_attribute_ushort"); + TESTING("H5LTset_attribute_ushort"); - /* Set the attribute */ - if ( H5LTset_attribute_ushort( loc_id, obj_name, ATTR7_NAME, attr_ushort_in, (size_t)5 ) < 0 ) - return -1; + /* Set the attribute */ + if ( H5LTset_attribute_ushort( loc_id, obj_name, ATTR7_NAME, attr_ushort_in, (size_t)5 ) < 0 ) + return -1; - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_ushort test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_ushort test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_ushort"); + TESTING("H5LTget_attribute_ushort"); - /* Get the attribute */ - if ( H5LTget_attribute_ushort( loc_id, obj_name, ATTR7_NAME, attr_ushort_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute_ushort( loc_id, obj_name, ATTR7_NAME, attr_ushort_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_ushort_in[i] != attr_ushort_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_ushort_in[i] != attr_ushort_out[i] ) { + return -1; + } + } - /* Get the attribute */ - if ( H5LTget_attribute( loc_id, obj_name, ATTR7_NAME, H5T_NATIVE_USHORT, attr_ushort_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute( loc_id, obj_name, ATTR7_NAME, H5T_NATIVE_USHORT, attr_ushort_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_ushort_in[i] != attr_ushort_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_ushort_in[i] != attr_ushort_out[i] ) { + return -1; + } + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTset_attribute_int test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_int test + *------------------------------------------------------------------------- + */ - TESTING("H5LTset_attribute_uint"); + TESTING("H5LTset_attribute_uint"); - /* Set the attribute */ - if ( H5LTset_attribute_uint( loc_id, obj_name, ATTR8_NAME, attr_uint_in, (size_t)5 ) < 0 ) - return -1; + /* Set the attribute */ + if ( H5LTset_attribute_uint( loc_id, obj_name, ATTR8_NAME, attr_uint_in, (size_t)5 ) < 0 ) + return -1; - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_int test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_int test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_uint"); + TESTING("H5LTget_attribute_uint"); - /* Get the attribute */ - if ( H5LTget_attribute_uint( loc_id, obj_name, ATTR8_NAME, attr_uint_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute_uint( loc_id, obj_name, ATTR8_NAME, attr_uint_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_uint_in[i] != attr_uint_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_uint_in[i] != attr_uint_out[i] ) { + return -1; + } + } - /* Get the attribute */ - if ( H5LTget_attribute( loc_id, obj_name, ATTR8_NAME, H5T_NATIVE_UINT, attr_uint_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute( loc_id, obj_name, ATTR8_NAME, H5T_NATIVE_UINT, attr_uint_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_uint_in[i] != attr_uint_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_uint_in[i] != attr_uint_out[i] ) { + return -1; + } + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTset_attribute_ulong test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_ulong test + *------------------------------------------------------------------------- + */ - TESTING("H5LTset_attribute_ulong"); + TESTING("H5LTset_attribute_ulong"); - /* Set the attribute */ - if ( H5LTset_attribute_ulong( loc_id, obj_name, ATTR9_NAME, attr_ulong_in, (size_t)5 ) < 0 ) - return -1; + /* Set the attribute */ + if ( H5LTset_attribute_ulong( loc_id, obj_name, ATTR9_NAME, attr_ulong_in, (size_t)5 ) < 0 ) + return -1; - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_long test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_long test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_ulong"); + TESTING("H5LTget_attribute_ulong"); - /* Get the attribute */ - if ( H5LTget_attribute_ulong( loc_id, obj_name, ATTR9_NAME, attr_ulong_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute_ulong( loc_id, obj_name, ATTR9_NAME, attr_ulong_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_ulong_in[i] != attr_ulong_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_ulong_in[i] != attr_ulong_out[i] ) { + return -1; + } + } - /* Get the attribute */ - if ( H5LTget_attribute( loc_id, obj_name, ATTR9_NAME, H5T_NATIVE_ULONG, attr_ulong_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute( loc_id, obj_name, ATTR9_NAME, H5T_NATIVE_ULONG, attr_ulong_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_ulong_in[i] != attr_ulong_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_ulong_in[i] != attr_ulong_out[i] ) { + return -1; + } + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTset_attribute_float test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_float test + *------------------------------------------------------------------------- + */ - TESTING("H5LTset_attribute_float"); + TESTING("H5LTset_attribute_float"); - /* Set the attribute */ - if ( H5LTset_attribute_float( loc_id, obj_name, ATTR10_NAME, attr_float_in, (size_t)5 ) < 0 ) - return -1; + /* Set the attribute */ + if ( H5LTset_attribute_float( loc_id, obj_name, ATTR10_NAME, attr_float_in, (size_t)5 ) < 0 ) + return -1; - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_float test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_float test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_float"); + TESTING("H5LTget_attribute_float"); - /* Get the attribute */ - if ( H5LTget_attribute_float( loc_id, obj_name, ATTR10_NAME, attr_float_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute_float( loc_id, obj_name, ATTR10_NAME, attr_float_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_float_in[i] != attr_float_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_float_in[i] != attr_float_out[i] ) { + return -1; + } + } - /* Get the attribute */ - if ( H5LTget_attribute( loc_id, obj_name, ATTR10_NAME, H5T_NATIVE_FLOAT, attr_float_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute( loc_id, obj_name, ATTR10_NAME, H5T_NATIVE_FLOAT, attr_float_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_float_in[i] != attr_float_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_float_in[i] != attr_float_out[i] ) { + return -1; + } + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTset_attribute_double test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTset_attribute_double test + *------------------------------------------------------------------------- + */ - TESTING("H5LTset_attribute_double"); + TESTING("H5LTset_attribute_double"); - /* Set the attribute */ - if ( H5LTset_attribute_double( loc_id, obj_name, ATTR11_NAME, attr_double_in, (size_t)5 ) < 0 ) - return -1; + /* Set the attribute */ + if ( H5LTset_attribute_double( loc_id, obj_name, ATTR11_NAME, attr_double_in, (size_t)5 ) < 0 ) + return -1; - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_double test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_double test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_double"); + TESTING("H5LTget_attribute_double"); - /* Get the attribute */ - if ( H5LTget_attribute_double( loc_id, obj_name, ATTR11_NAME, attr_double_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute_double( loc_id, obj_name, ATTR11_NAME, attr_double_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_double_in[i] != attr_double_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_double_in[i] != attr_double_out[i] ) { + return -1; + } + } - /* Get the attribute */ - if ( H5LTget_attribute( loc_id, obj_name, ATTR11_NAME, H5T_NATIVE_DOUBLE, attr_double_out ) < 0 ) - return -1; + /* Get the attribute */ + if ( H5LTget_attribute( loc_id, obj_name, ATTR11_NAME, H5T_NATIVE_DOUBLE, attr_double_out ) < 0 ) + return -1; - for (i = 0; i < 5; i++) - { - if ( attr_double_in[i] != attr_double_out[i] ) { - return -1; - } - } + for (i = 0; i < 5; i++) + { + if ( attr_double_in[i] != attr_double_out[i] ) { + return -1; + } + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_ndims test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_ndims test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_ndims"); + TESTING("H5LTget_attribute_ndims"); - if ( H5LTget_attribute_ndims( loc_id, obj_name, ATTR2_NAME, &rank_out ) < 0 ) - return -1; + if ( H5LTget_attribute_ndims( loc_id, obj_name, ATTR2_NAME, &rank_out ) < 0 ) + return -1; - if ( rank_out != 1 ) { - return -1; - } + if ( rank_out != 1 ) { + return -1; + } - PASSED(); + PASSED(); -/*------------------------------------------------------------------------- - * H5LTget_attribute_info test - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * H5LTget_attribute_info test + *------------------------------------------------------------------------- + */ - TESTING("H5LTget_attribute_info"); + TESTING("H5LTget_attribute_info"); - dims_out = malloc( sizeof(hsize_t) * rank_out ); + dims_out = (hsize_t*) malloc( sizeof(hsize_t) * rank_out ); - if ( H5LTget_attribute_info( loc_id, obj_name, ATTR2_NAME, dims_out, &type_class, - &type_size) < 0 ) - return -1; + if ( H5LTget_attribute_info( loc_id, obj_name, ATTR2_NAME, dims_out, &type_class, + &type_size) < 0 ) + return -1; - for (i = 0; i < rank_out; i++) - { - if ( dims_out[i] != 5 ) { - return -1; - } - } + for (i = 0; i < rank_out; i++) + { + if ( dims_out[i] != 5 ) { + return -1; + } + } - if ( type_class != H5T_INTEGER ) { - return -1; - } + if ( type_class != H5T_INTEGER ) { + return -1; + } - if ( dims_out ) - free( dims_out ); + if ( dims_out ) + free( dims_out ); - PASSED(); + PASSED(); - return 0; + return 0; } /*------------------------------------------------------------------------- - * subroutine for test_text_dtype(): test_integers(). - *------------------------------------------------------------------------- - */ +* subroutine for test_text_dtype(): test_integers(). +*------------------------------------------------------------------------- +*/ static int test_integers(void) { hid_t dtype; @@ -1094,9 +1091,9 @@ out: } /*------------------------------------------------------------------------- - * subroutine for test_text_dtype(): test_fps(). - *------------------------------------------------------------------------- - */ +* subroutine for test_text_dtype(): test_fps(). +*------------------------------------------------------------------------- +*/ static int test_fps(void) { hid_t dtype; @@ -1145,9 +1142,9 @@ out: } /*------------------------------------------------------------------------- - * subroutine for test_text_dtype(): test_strings(). - *------------------------------------------------------------------------- - */ +* subroutine for test_text_dtype(): test_strings(). +*------------------------------------------------------------------------- +*/ static int test_strings(void) { hid_t dtype; @@ -1231,9 +1228,9 @@ out: } /*------------------------------------------------------------------------- - * subroutine for test_text_dtype(): test_opaques(). - *------------------------------------------------------------------------- - */ +* subroutine for test_text_dtype(): test_opaques(). +*------------------------------------------------------------------------- +*/ static int test_opaques(void) { hid_t dtype; @@ -1280,9 +1277,9 @@ out: } /*------------------------------------------------------------------------- - * subroutine for test_text_dtype(): test_enums(). - *------------------------------------------------------------------------- - */ +* subroutine for test_text_dtype(): test_enums(). +*------------------------------------------------------------------------- +*/ static int test_enums(void) { hid_t dtype; @@ -1321,8 +1318,8 @@ static int test_enums(void) if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) goto out; /*if(strcmp(dt_str, "H5T_ENUM {\n H5T_STD_I32LE;\n \"RED\" 5;\n \"GREEN\" 6;\n \"BLUE\" 7;\n \"WHITE\" 8;\n }")) { - printf("dt=\n%s\n", dt_str); - goto out; + printf("dt=\n%s\n", dt_str); + goto out; }*/ free(dt_str); @@ -1338,9 +1335,9 @@ out: } /*------------------------------------------------------------------------- - * subroutine for test_text_dtype(): test_variables(). - *------------------------------------------------------------------------- - */ +* subroutine for test_text_dtype(): test_variables(). +*------------------------------------------------------------------------- +*/ static int test_variables(void) { hid_t dtype; @@ -1393,9 +1390,9 @@ out: } /*------------------------------------------------------------------------- - * subroutine for test_text_dtype(): test_arrays(). - *------------------------------------------------------------------------- - */ +* subroutine for test_text_dtype(): test_arrays(). +*------------------------------------------------------------------------- +*/ static int test_arrays(void) { hid_t dtype; @@ -1431,8 +1428,8 @@ static int test_arrays(void) if(H5LTdtype_to_text(dtype, dt_str, H5LT_DDL, &str_len)<0) goto out; /*if(strcmp(dt_str, "H5T_ARRAY { [5][7][13] H5T_ARRAY { [17][19] H5T_COMPOUND { H5T_STD_I8BE \"arr_compound_1\"; H5T_STD_I32BE \"arr_compound_2\"; } } }")) { - printf("dt=\n%s\n", dt_str); - goto out; + printf("dt=\n%s\n", dt_str); + goto out; }*/ free(dt_str); @@ -1448,9 +1445,9 @@ out: } /*------------------------------------------------------------------------- - * subroutine for test_text_dtype(): test_compounds(). - *------------------------------------------------------------------------- - */ +* subroutine for test_text_dtype(): test_compounds(). +*------------------------------------------------------------------------- +*/ static int test_compounds(void) { hid_t dtype; @@ -1513,9 +1510,9 @@ out: } /*------------------------------------------------------------------------- - * subroutine for test_text_dtype(): test_complicated_compound(). - *------------------------------------------------------------------------- - */ +* subroutine for test_text_dtype(): test_complicated_compound(). +*------------------------------------------------------------------------- +*/ static int test_complicated_compound(void) { hid_t dtype; @@ -1532,8 +1529,8 @@ static int test_complicated_compound(void) /* compose the name of the file to open, using the srcdir, if appropriate */ if(srcdir) { - strcpy(filename, srcdir); - strcat(filename, "/"); + strcpy(filename, srcdir); + strcat(filename, "/"); } strcat(filename, INPUT_FILE); @@ -1541,14 +1538,14 @@ static int test_complicated_compound(void) fp = fopen(filename, "r"); if(fp == NULL) { - printf( "Could not find file %s. Try set $srcdir \n", filename); - goto out; + printf( "Could not find file %s. Try set $srcdir \n", filename); + goto out; } /* This part reads in the input as a string in a slow manner. GNU C - * Library has convenient function getline() but isn't available on - * all machines. - */ + * Library has convenient function getline() but isn't available on + * all machines. + */ if((line = (char*)calloc(size, sizeof(char)))==NULL) goto out; if(fgets(line, (int)size, fp)==NULL) @@ -1593,9 +1590,9 @@ out: } /*------------------------------------------------------------------------- - * test H5LTtext_to_dtype function - *------------------------------------------------------------------------- - */ +* test H5LTtext_to_dtype function +*------------------------------------------------------------------------- +*/ static int test_text_dtype(void) { TESTING("H5LTtext_to_dtype"); @@ -1634,30 +1631,30 @@ out: } /*------------------------------------------------------------------------- - * the main program - *------------------------------------------------------------------------- - */ +* the main program +*------------------------------------------------------------------------- +*/ int main( void ) { - int nerrors=0; + int nerrors=0; - /* test dataset functions */ - nerrors += test_dsets(); + /* test dataset functions */ + nerrors += test_dsets(); - /* test attribute functions */ - nerrors += test_attr(); + /* test attribute functions */ + nerrors += test_attr(); - /* test text-dtype functions */ - nerrors += test_text_dtype(); + /* test text-dtype functions */ + nerrors += test_text_dtype(); - /* check for errors */ - if (nerrors) - goto error; + /* check for errors */ + if (nerrors) + goto error; - return 0; + return 0; error: - return 1; + return 1; } |