summaryrefslogtreecommitdiffstats
path: root/test/dtypes.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-07-16 20:48:40 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-07-16 20:48:40 (GMT)
commitc97fddc786356a1832e6cb3ac3f28b781d01584d (patch)
treee9ea99bbf3387f45b18d3b6503597a1c63662cab /test/dtypes.c
parentcb516077680041aecc338936d1aa3f84347e0e0d (diff)
downloadhdf5-c97fddc786356a1832e6cb3ac3f28b781d01584d.zip
hdf5-c97fddc786356a1832e6cb3ac3f28b781d01584d.tar.gz
hdf5-c97fddc786356a1832e6cb3ac3f28b781d01584d.tar.bz2
[svn-r8892] Purpose:
Code cleanup Description: Clean up a bunch of warnings and bring new code better inline with current library coding practice. Platforms tested: FreeBSD 4.10 (sleipnir) w/parallel Too minor to require h5committest Misc. update:
Diffstat (limited to 'test/dtypes.c')
-rw-r--r--test/dtypes.c32
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();