summaryrefslogtreecommitdiffstats
path: root/test/err_compat.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2021-08-17 19:55:18 (GMT)
committerGitHub <noreply@github.com>2021-08-17 19:55:18 (GMT)
commitc0ef1fd6de3ff20cc8fc49c05ca71254c784bea6 (patch)
treefb2bdf05e276e3614b3b5c343447cd82f4e6718b /test/err_compat.c
parent2bca2ca6f1ef1b60bb8541413c5f2e68ff5549d3 (diff)
downloadhdf5-c0ef1fd6de3ff20cc8fc49c05ca71254c784bea6.zip
hdf5-c0ef1fd6de3ff20cc8fc49c05ca71254c784bea6.tar.gz
hdf5-c0ef1fd6de3ff20cc8fc49c05ca71254c784bea6.tar.bz2
Reverts PR 906 and 907 due to binary compatibility issues (#918)
Diffstat (limited to 'test/err_compat.c')
-rw-r--r--test/err_compat.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/test/err_compat.c b/test/err_compat.c
index 6ad69d8..6f3cfb3 100644
--- a/test/err_compat.c
+++ b/test/err_compat.c
@@ -228,14 +228,16 @@ test_error_compat(void)
if ((sid = H5Screate_simple(2, dims, NULL)) < 0)
TEST_ERROR;
- /* Use H5Eget_auto2 to query the default printing function. */
+ /* Use H5Eget_auto2 to query the default printing function. The library
+ *should indicate H5Eprint2 as the default. */
if (H5Eget_auto2(H5E_DEFAULT, &old_func2, &old_data) < 0)
TEST_ERROR;
if (old_data != NULL)
TEST_ERROR;
- if (old_func2 == NULL)
+ if (!old_func2 || (H5E_auto2_t)H5Eprint2 != old_func2)
TEST_ERROR;
+ /* This function sets the default printing function to be H5Eprint2. */
if (H5Eset_auto2(H5E_DEFAULT, old_func2, old_data) < 0)
TEST_ERROR;
@@ -280,12 +282,12 @@ test_error_compat(void)
if (did >= 0)
TEST_ERROR;
- /* This function changes the new-style printing function to the original. */
- if (H5Eset_auto2(H5E_DEFAULT, old_func2, NULL) < 0)
+ /* This function changes the new-style printing function back to the default H5Eprint2. */
+ if (H5Eset_auto2(H5E_DEFAULT, (H5E_auto2_t)H5Eprint2, NULL) < 0)
TEST_ERROR;
- /* This call should work because the H5Eset_auto2 above set the default printing
- * function to H5Eprint2. It simply returns user_print1. */
+ /* This call should work because the H5Eset_auto2 above restored the default printing
+ * function H5Eprint2. It simply returns user_print1. */
if ((ret = H5Eget_auto1(&old_func1, &old_data)) < 0)
TEST_ERROR;
if (old_data != NULL)
@@ -303,7 +305,7 @@ test_error_compat(void)
TEST_ERROR;
if (old_data != NULL)
TEST_ERROR;
- if (old_func2 == NULL)
+ if (!old_func2 || (H5E_auto2_t)H5Eprint2 != old_func2)
TEST_ERROR;
/* Try the printing function. Dataset creation should fail because the file