From: Martin Schwenke Date: Mon, 9 Oct 2017 03:56:00 +0000 (+1100) Subject: ctdb-tests: Strengthen some tests X-Git-Tag: tevent-0.9.34~204 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a0c5d2e2b542754ccb8d8c59396119005ce6c9fd;p=thirdparty%2Fsamba.git ctdb-tests: Strengthen some tests Check for the expected result instead of just any failure. Signed-off-by: Martin Schwenke Reviewed-by: Volker Lendecke --- 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); }