Skip to content
Snippets Groups Projects
Commit b69c76f4 authored by godzie44's avatar godzie44 Committed by Aleksandr Lyapunov
Browse files

test: fix null pointer dereference in `coio::test_getaddrinfo`

unit test, in case when assertion failed

NO_DOC=test
NO_CHANGELOG=test
parent 45f9759f
No related branches found
No related tags found
No related merge requests found
...@@ -95,7 +95,8 @@ test_getaddrinfo(void) ...@@ -95,7 +95,8 @@ test_getaddrinfo(void)
rc = coio_getaddrinfo("non_exists_hostname", port, NULL, &i, rc = coio_getaddrinfo("non_exists_hostname", port, NULL, &i,
15768000000); 15768000000);
isnt(rc, 0, "getaddrinfo retval"); isnt(rc, 0, "getaddrinfo retval");
const char *errmsg = diag_get()->last->errmsg; const error *last_err = diag_get()->last;
const char *errmsg = last_err == NULL ? "" : last_err->errmsg;
bool is_match_with_exp = strstr(errmsg, "getaddrinfo") == errmsg; bool is_match_with_exp = strstr(errmsg, "getaddrinfo") == errmsg;
is(is_match_with_exp, true, "getaddrinfo error message"); is(is_match_with_exp, true, "getaddrinfo error message");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment