diff options
Diffstat (limited to 'test/dtypes.c')
-rw-r--r-- | test/dtypes.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/test/dtypes.c b/test/dtypes.c index dcc14bd..e0fc7be 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -1885,13 +1885,13 @@ test_encode(void) double d; }; hid_t file=-1, tid1=-1, tid2=-1; - hid_t decoded_tid1, decoded_tid2; + hid_t decoded_tid1=-1, decoded_tid2=-1; char filename[1024]; char compnd_type[]="Compound_type", enum_type[]="Enum_type"; short enum_val; size_t cmpd_buf_size = 0; size_t enum_buf_size = 0; - unsigned char *cmpd_buf, *enum_buf; + unsigned char *cmpd_buf=NULL, *enum_buf=NULL; TESTING("functions of encoding and decoding data types"); @@ -1990,6 +1990,13 @@ test_encode(void) goto error; } /* end if */ + /* Verify that the datatype was copied exactly */ + if(H5Tequal(decoded_tid1, tid1)<=0) { + H5_FAILED(); + printf("Datatype wasn't encoded & decoded identically\n"); + goto error; + } /* end if */ + /* Query member number and member index by name, for compound type. */ if(H5Tget_nmembers(decoded_tid1)!=4) { H5_FAILED(); @@ -2026,6 +2033,13 @@ test_encode(void) goto error; } /* end if */ + /* Verify that the datatype was copied exactly */ + if(H5Tequal(decoded_tid2, tid2)<=0) { + H5_FAILED(); + printf("Datatype wasn't encoded & decoded identically\n"); + goto error; + } /* end if */ + /* Query member number and member index by name, for enumeration type. */ if(H5Tget_nmembers(decoded_tid2)!=5) { H5_FAILED(); @@ -2116,6 +2130,13 @@ test_encode(void) goto error; } /* end if */ + /* Verify that the datatype was copied exactly */ + if(H5Tequal(decoded_tid1, tid1)<=0) { + H5_FAILED(); + printf("Datatype wasn't encoded & decoded identically\n"); + goto error; + } /* end if */ + /* Query member number and member index by name, for compound type. */ if(H5Tget_nmembers(decoded_tid1)!=4) { H5_FAILED(); @@ -2155,6 +2176,13 @@ test_encode(void) goto error; } /* end if */ + /* Verify that the datatype was copied exactly */ + if(H5Tequal(decoded_tid2, tid2)<=0) { + H5_FAILED(); + printf("Datatype wasn't encoded & decoded identically\n"); + goto error; + } /* end if */ + /* Query member number and member index by name, for enumeration type. */ if(H5Tget_nmembers(decoded_tid2)!=5) { H5_FAILED(); |