summaryrefslogtreecommitdiffstats
path: root/test/errtest.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-09-04 22:04:08 +0200
committerRichard Levitte <levitte@openssl.org>2019-09-12 17:59:52 +0200
commitb13342e933c507c4ce0eda0a0193339a111f27a5 (patch)
tree27251f00624c771cd42e0f649513ef8330659a40 /test/errtest.c
parent06ff79bd773d0b4214e4b6a8a1332a3355b17742 (diff)
Modernise the ERR functionality further (new functions and deprecations)
ERR_func_error_string() essentially returns NULL, and since all function codes are now removed for all intents and purposes, this function has fallen out of use and cannot be modified to suit the data, since its only function is to interpret an error code. To compensate for the loss of error code, we instead provide new functions that extracts the function name strings from an error record: - ERR_get_error_func() - ERR_peek_error_func() - ERR_peek_last_error_func() Similarly, the once all encompasing functions ERR_peek_last_error_line_data(), ERR_peek_error_line_data() and ERR_get_error_line_data() lack the capability of getting the function name string, so we deprecate those and add these functions to replace them: - ERR_get_error_all() - ERR_peek_error_all() - ERR_peek_last_error_all() Finally, we adjust a few lines of code that used the now deprecated functions. Fixes #9756 Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9756)
Diffstat (limited to 'test/errtest.c')
-rw-r--r--test/errtest.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/errtest.c b/test/errtest.c
index ffe6532240..179c338c45 100644
--- a/test/errtest.c
+++ b/test/errtest.c
@@ -40,7 +40,7 @@ static int vdata_appends(void)
CRYPTOerr(0, ERR_R_MALLOC_FAILURE);
ERR_add_error_data(1, "hello ");
ERR_add_error_data(1, "world");
- ERR_get_error_line_data(NULL, NULL, &data, NULL);
+ ERR_peek_error_data(&data, NULL);
return TEST_str_eq(data, "hello world");
}
@@ -63,7 +63,7 @@ static int raised_error(void)
#endif
ERR_raise_data(ERR_LIB_SYS, ERR_R_INTERNAL_ERROR,
"calling exit()");
- if (!TEST_ulong_ne(e = ERR_get_error_line_data(&f, &l, &data, NULL), 0)
+ if (!TEST_ulong_ne(e = ERR_get_error_all(&f, &l, NULL, &data, NULL), 0)
|| !TEST_int_eq(ERR_GET_REASON(e), ERR_R_INTERNAL_ERROR)
#if !defined(OPENSSL_NO_FILENAMES) && !defined(OPENSSL_NO_ERR)
|| !TEST_int_eq(l, line)