Skip to content

Commit

Permalink
Restore some changes to compare_stype4_data()
Browse files Browse the repository at this point in the history
  • Loading branch information
vchoi-hdfgroup committed Sep 13, 2023
1 parent e87a93f commit c374a38
Showing 1 changed file with 14 additions and 35 deletions.
49 changes: 14 additions & 35 deletions test/cmpd_dset.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,48 +134,27 @@ static int compare_stype4_data(void *expect_buf, void *rbuf);
static int
compare_stype4_data(void *expect_buf, void *rbuf)
{
int i;
unsigned err = FALSE;
int i;

for (i = 0; i < (int)(NX * NY); i++) {
stype4 *s1_ptr;
stype4 *s2_ptr;
s1_ptr = ((stype4 *)expect_buf) + i;
s2_ptr = ((stype4 *)rbuf) + i;

if (s1_ptr->a != s2_ptr->a) {
printf("a is different\n");
err = TRUE;
}
else if (s1_ptr->b != s2_ptr->b) {
printf("b is different\n");
err = TRUE;
}
else if (s1_ptr->c[0] != s2_ptr->c[0]) {
printf("c[0] is different\n");
err = TRUE;
}
else if (s1_ptr->c[2] != s2_ptr->c[2]) {
printf("c[2] is different\n");
err = TRUE;
}
else if (s1_ptr->c[4] != s2_ptr->c[4]) {
printf("c[4] is different\n");
err = TRUE;
}
else if (s1_ptr->c[6] != s2_ptr->c[6]) {
printf("c[6] is different\n");
err = TRUE;
}
else if (s1_ptr->d != s2_ptr->d) {
printf("d is different\n");
err = TRUE;
}
else if (s1_ptr->e != s2_ptr->e) {
printf("e is different\n");
err = TRUE;
}
if (err) {
if (s1_ptr->a != s2_ptr->a || s1_ptr->b != s2_ptr->b || s1_ptr->c[0] != s2_ptr->c[0] ||
s1_ptr->c[2] != s2_ptr->c[2] || s1_ptr->c[4] != s2_ptr->c[4] || s1_ptr->c[6] != s2_ptr->c[6] ||
s1_ptr->d != s2_ptr->d || s1_ptr->e != s2_ptr->e || !H5_FLT_ABS_EQUAL(s1_ptr->f, s2_ptr->f) ||
!H5_FLT_ABS_EQUAL(s1_ptr->g, s2_ptr->g) || !H5_FLT_ABS_EQUAL(s1_ptr->h[1], s2_ptr->h[1]) ||
!H5_FLT_ABS_EQUAL(s1_ptr->h[3], s2_ptr->h[3]) || !H5_FLT_ABS_EQUAL(s1_ptr->h[5], s2_ptr->h[5]) ||
!H5_FLT_ABS_EQUAL(s1_ptr->h[7], s2_ptr->h[7]) || !H5_FLT_ABS_EQUAL(s1_ptr->h[9], s2_ptr->h[9]) ||
!H5_FLT_ABS_EQUAL(s1_ptr->h[11], s2_ptr->h[11]) ||
!H5_FLT_ABS_EQUAL(s1_ptr->h[13], s2_ptr->h[13]) ||
!H5_FLT_ABS_EQUAL(s1_ptr->h[15], s2_ptr->h[15]) || !H5_FLT_ABS_EQUAL(s1_ptr->i, s2_ptr->i) ||
!H5_FLT_ABS_EQUAL(s1_ptr->j, s2_ptr->j) || !H5_DBL_ABS_EQUAL(s1_ptr->k, s2_ptr->k) ||
!H5_DBL_ABS_EQUAL(s1_ptr->l, s2_ptr->l) || !H5_DBL_ABS_EQUAL(s1_ptr->m, s2_ptr->m) ||
!H5_DBL_ABS_EQUAL(s1_ptr->n, s2_ptr->n) ) {

H5_FAILED();
printf(" i=%d\n", i);
printf(" exp_buf={a=%d, b=%d, c=[%d,%d,%d,%d,%d,%d,%d,%d], d=%d, e=%d, f=%f, g=%f, "
Expand Down

0 comments on commit c374a38

Please sign in to comment.