Skip to content

Commit

Permalink
Fix failures in dtypes test on cygwin (HDFGroup#5077)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhendersonHDF authored Nov 7, 2024
1 parent d09ea66 commit c130d51
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/H5T.c
Original file line number Diff line number Diff line change
Expand Up @@ -5660,8 +5660,8 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co
old_npaths = H5T_g.npaths;

/* Set a few convenience variables */
new_api_func = (matched_path && conv->is_app && conv->u.app_func);
new_lib_func = (matched_path && !conv->is_app && conv->u.lib_func);
new_api_func = (matched_path && !noop_conv && conv->is_app && conv->u.app_func);
new_lib_func = (matched_path && !noop_conv && !conv->is_app && conv->u.lib_func);

/* If we didn't find the path, if the caller is an API function specifying
* a new hard conversion function, or if the caller is a private function
Expand Down
36 changes: 19 additions & 17 deletions test/dtypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -6436,16 +6436,17 @@ test__Float16(void)
}

if (is_little_endian) {
if (path->conv.u.lib_func != H5T__conv_noop) {
if (strcmp(path->name, "no-op") != 0) {
H5_FAILED();
printf("Conversion path for H5T_NATIVE_FLOAT16 -> H5T_IEEE_F16LE was not H5T__conv_noop\n");
printf("Conversion path for H5T_NATIVE_FLOAT16 -> H5T_IEEE_F16LE was not a no-op\n");
goto error;
}
}
else {
if (path->conv.u.lib_func != H5T__conv_order_opt) {
if (strcmp(path->name, "fbo(opt)") != 0) {
H5_FAILED();
printf("Conversion path for H5T_NATIVE_FLOAT16 -> H5T_IEEE_F16LE was not H5T__conv_order\n");
printf(
"Conversion path for H5T_NATIVE_FLOAT16 -> H5T_IEEE_F16LE was not a byte-swap conversion\n");
goto error;
}
}
Expand All @@ -6469,16 +6470,17 @@ test__Float16(void)
}

if (is_little_endian) {
if (path->conv.u.lib_func != H5T__conv_order_opt) {
if (strcmp(path->name, "fbo(opt)") != 0) {
H5_FAILED();
printf("Conversion path for H5T_NATIVE_FLOAT16 -> H5T_IEEE_F16BE was not H5T__conv_order\n");
printf(
"Conversion path for H5T_NATIVE_FLOAT16 -> H5T_IEEE_F16BE was not a byte-swap conversion\n");
goto error;
}
}
else {
if (path->conv.u.lib_func != H5T__conv_noop) {
if (strcmp(path->name, "no-op") != 0) {
H5_FAILED();
printf("Conversion path for H5T_NATIVE_FLOAT16 -> H5T_IEEE_F16BE was not H5T__conv_noop\n");
printf("Conversion path for H5T_NATIVE_FLOAT16 -> H5T_IEEE_F16BE was not a no-op\n");
goto error;
}
}
Expand Down Expand Up @@ -7393,7 +7395,7 @@ test_complex_type_conv_funcs(void)
printf("Invalid conversion path for H5T_NATIVE_FLOAT_COMPLEX -> H5T_NATIVE_FLOAT_COMPLEX\n");
goto error;
}
if (conv_path->conv.u.lib_func != H5T__conv_noop) {
if (strcmp(conv_path->name, "no-op") != 0) {
H5_FAILED();
printf("Conversion path for H5T_NATIVE_FLOAT_COMPLEX -> H5T_NATIVE_FLOAT_COMPLEX was not a no-op\n");
goto error;
Expand All @@ -7409,7 +7411,7 @@ test_complex_type_conv_funcs(void)
printf("Invalid conversion path for H5T_NATIVE_DOUBLE_COMPLEX -> H5T_NATIVE_DOUBLE_COMPLEX\n");
goto error;
}
if (conv_path->conv.u.lib_func != H5T__conv_noop) {
if (strcmp(conv_path->name, "no-op") != 0) {
H5_FAILED();
printf(
"Conversion path for H5T_NATIVE_DOUBLE_COMPLEX -> H5T_NATIVE_DOUBLE_COMPLEX was not a no-op\n");
Expand All @@ -7426,7 +7428,7 @@ test_complex_type_conv_funcs(void)
printf("Invalid conversion path for H5T_NATIVE_LDOUBLE_COMPLEX -> H5T_NATIVE_LDOUBLE_COMPLEX\n");
goto error;
}
if (conv_path->conv.u.lib_func != H5T__conv_noop) {
if (strcmp(conv_path->name, "no-op") != 0) {
H5_FAILED();
printf(
"Conversion path for H5T_NATIVE_LDOUBLE_COMPLEX -> H5T_NATIVE_LDOUBLE_COMPLEX was not a no-op\n");
Expand All @@ -7453,7 +7455,7 @@ test_complex_type_conv_funcs(void)
printf("Can't find datatype conversion path\n");
goto error;
}
if (conv_path->conv.u.lib_func != H5T__conv_order) {
if (strcmp(conv_path->name, "complexbo") != 0) {
H5_FAILED();
printf("Conversion path for H5T_COMPLEX_IEEE_F32LE -> H5T_COMPLEX_IEEE_F32BE was not a byte-swap "
"conversion\n");
Expand All @@ -7465,7 +7467,7 @@ test_complex_type_conv_funcs(void)
printf("Can't find datatype conversion path\n");
goto error;
}
if (conv_path->conv.u.lib_func != H5T__conv_order) {
if (strcmp(conv_path->name, "complexbo") != 0) {
H5_FAILED();
printf("Conversion path for H5T_COMPLEX_IEEE_F32BE -> H5T_COMPLEX_IEEE_F32LE was not a byte-swap "
"conversion\n");
Expand Down Expand Up @@ -7881,7 +7883,7 @@ test_complex_array_compat_conv(void)
printf("Invalid conversion path for complex type -> array type\n");
goto error;
}
if (conv_path->conv.u.lib_func != H5T__conv_complex_compat) {
if (strcmp(conv_path->name, "complex_array_compat") != 0) {
H5_FAILED();
printf("Conversion path for complex type -> array type was not a no-op\n");
goto error;
Expand All @@ -7896,7 +7898,7 @@ test_complex_array_compat_conv(void)
printf("Invalid conversion path for array type -> complex type\n");
goto error;
}
if (conv_path->conv.u.lib_func != H5T__conv_complex_compat) {
if (strcmp(conv_path->name, "array_complex_compat") != 0) {
H5_FAILED();
printf("Conversion path for array type -> complex type was not a no-op\n");
goto error;
Expand Down Expand Up @@ -8338,7 +8340,7 @@ test_complex_compound_compat_conv(void)
printf("Invalid conversion path for complex type -> compound type\n");
goto error;
}
if (conv_path->conv.u.lib_func != H5T__conv_complex_compat) {
if (strcmp(conv_path->name, "complex_compound_compat") != 0) {
H5_FAILED();
printf("Conversion path for complex type -> compound type was not a no-op\n");
goto error;
Expand All @@ -8353,7 +8355,7 @@ test_complex_compound_compat_conv(void)
printf("Invalid conversion path for compound type -> complex type\n");
goto error;
}
if (conv_path->conv.u.lib_func != H5T__conv_complex_compat) {
if (strcmp(conv_path->name, "compound_complex_compat") != 0) {
H5_FAILED();
printf("Conversion path for compound type -> complex type was not a no-op\n");
goto error;
Expand Down

0 comments on commit c130d51

Please sign in to comment.