diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2015-02-24 20:30:07 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2015-02-24 20:30:07 (GMT) |
commit | 48d9c30923a5d298670cf1f8e930c9a9624f80b9 (patch) | |
tree | 955523c057398e37ce88af52fe58c762b14979ea /hl/test/test_lite.c | |
parent | e171ee01f180cbd326efbdf3254cee94bc4d9622 (diff) | |
download | hdf5-48d9c30923a5d298670cf1f8e930c9a9624f80b9.zip hdf5-48d9c30923a5d298670cf1f8e930c9a9624f80b9.tar.gz hdf5-48d9c30923a5d298670cf1f8e930c9a9624f80b9.tar.bz2 |
[svn-r26294] Fix for HDFFV-9132.
tested: h5committest
Diffstat (limited to 'hl/test/test_lite.c')
-rw-r--r-- | hl/test/test_lite.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index d61d6cf..19d3759 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -36,10 +36,12 @@ #define DIM 6 +#define ATTR_NAME_SUB "att" #define ATTR1_NAME "attr string" #define ATTR2_NAME "attr char" #define ATTR3_NAME "attr short" #define ATTR4_NAME "attr int" +#define ATTR_NAME_EXT "att int ext" #define ATTR5_NAME "attr long" #define ATTR6_NAME "attr uchar" #define ATTR7_NAME "attr ushort" @@ -646,6 +648,14 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name ) if ( H5LTset_attribute_int( loc_id, obj_name, ATTR4_NAME, attr_int_in, (size_t)5 ) < 0 ) return -1; + /* Set the attribute which is a substring of an existing attribute */ + if ( H5LTset_attribute_int( loc_id, obj_name, ATTR_NAME_SUB, attr_int_in, (size_t)5 ) < 0 ) + return -1; + + /* Set the attribute which is an extension of an existing attribute */ + if ( H5LTset_attribute_int( loc_id, obj_name, ATTR_NAME_EXT, attr_int_in, (size_t)5 ) < 0 ) + return -1; + PASSED(); /*------------------------------------------------------------------------- @@ -666,6 +676,26 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name ) } } + if ( H5LTget_attribute_int( loc_id, obj_name, ATTR_NAME_SUB, attr_int_out ) < 0 ) + return -1; + + for (i = 0; i < 5; i++) + { + if ( attr_int_in[i] != attr_int_out[i] ) { + return -1; + } + } + + if ( H5LTget_attribute_int( loc_id, obj_name, ATTR_NAME_EXT, attr_int_out ) < 0 ) + 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; |