From a0c5d2e2b542754ccb8d8c59396119005ce6c9fd Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Mon, 9 Oct 2017 14:56:00 +1100 Subject: [PATCH] ctdb-tests: Strengthen some tests Check for the expected result instead of just any failure. Signed-off-by: Martin Schwenke Reviewed-by: Volker Lendecke --- ctdb/tests/src/protocol_util_test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ctdb/tests/src/protocol_util_test.c b/ctdb/tests/src/protocol_util_test.c index fd1b0679414..eb7eb0ff88f 100644 --- a/ctdb/tests/src/protocol_util_test.c +++ b/ctdb/tests/src/protocol_util_test.c @@ -49,7 +49,7 @@ static void test_sock_addr_from_string_bad(const char *ip, bool with_port) int ret; ret = ctdb_sock_addr_from_string(ip, &sa, with_port); - assert(ret != 0); + assert(ret == EINVAL); } static void test_sock_addr_cmp(const char *ip1, const char *ip2, @@ -141,7 +141,7 @@ static void test_connection_from_string_bad(const char *conn_str) int ret; ret = ctdb_connection_from_string(conn_str, false, &conn); - assert(ret != 0); + assert(ret == EINVAL); } /* @@ -240,7 +240,7 @@ static void test_connection_list_read_bad(const char *s1) close(pipefd[0]); ret = ctdb_connection_list_read(tmp_ctx, false, &conn_list); - assert(ret != 0); + assert(ret == EINVAL); talloc_free(tmp_ctx); } -- 2.34.1