diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2009-04-28 21:42:33 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2009-04-28 21:42:33 (GMT) |
commit | 71b49b0f9bd3cd5ac7d9a331260f3d5bfb3eb6d8 (patch) | |
tree | fd6ed60dd18d7838bb68552133e36d580739457c /hl/test | |
parent | 4d6fcb288ac03d577335e115268bc7bc6397b2dd (diff) | |
download | hdf5-71b49b0f9bd3cd5ac7d9a331260f3d5bfb3eb6d8.zip hdf5-71b49b0f9bd3cd5ac7d9a331260f3d5bfb3eb6d8.tar.gz hdf5-71b49b0f9bd3cd5ac7d9a331260f3d5bfb3eb6d8.tar.bz2 |
[svn-r16880] Fixed a bug in H5LTtext_to_dtype. When the data type is enumerate and the super type is different from
the native integer, the value wasn't converted. I fixed it and corrected the test, too.
Tested with h5committest.
Diffstat (limited to 'hl/test')
-rw-r--r-- | hl/test/test_lite.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index 8c9fb30..ad12fb2 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -1291,6 +1291,7 @@ static int test_enums(void) H5T_class_t type_class; char* dt_str; size_t str_len; + H5T_order_t native_order = H5Tget_order(H5T_NATIVE_INT); TESTING3(" text for enum types"); @@ -1302,6 +1303,12 @@ static int test_enums(void) if(type_class != H5T_ENUM) goto out; + /* Convert the variable before using it */ + if(!H5Tequal(H5T_STD_I32LE, H5T_NATIVE_INT)) { + if(H5Tconvert(H5T_NATIVE_INT, H5T_STD_I32LE, 1, &value1, NULL, H5P_DEFAULT) < 0) + goto out; + } + if(H5Tenum_nameof(dtype, &value1, name1, size)<0) goto out; if(strcmp(name1, "BLUE")) @@ -1309,6 +1316,13 @@ static int test_enums(void) if(H5Tenum_valueof(dtype, name2, &value2)<0) goto out; + + /* Convert the variable before comparing it */ + if(!H5Tequal(H5T_STD_I32LE, H5T_NATIVE_INT)) { + if(H5Tconvert(H5T_NATIVE_INT, H5T_STD_I32LE, 1, &value2, NULL, H5P_DEFAULT) < 0) + goto out; + } + if(value2 != 8) goto out; |