From patchwork Mon Jun 4 07:27:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sun Lianwen X-Patchwork-Id: 924867 X-Patchwork-Delegate: petr.vorel@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cn.fujitsu.com Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40zmhn0DPjz9rvt for ; Mon, 4 Jun 2018 17:26:48 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 770613E61C3 for ; Mon, 4 Jun 2018 09:26:45 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [IPv6:2001:4b78:1:20::4]) by picard.linux.it (Postfix) with ESMTP id 453D83E6106 for ; Mon, 4 Jun 2018 09:26:44 +0200 (CEST) Received: from heian.cn.fujitsu.com (mail.cn.fujitsu.com [183.91.158.132]) by in-4.smtp.seeweb.it (Postfix) with ESMTP id E99AF1001279 for ; Mon, 4 Jun 2018 09:26:40 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="40709993" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 04 Jun 2018 15:26:37 +0800 Received: from G08CNEXCHPEKD03.g08.fujitsu.local (unknown [10.167.33.85]) by cn.fujitsu.com (Postfix) with ESMTP id C37E64B41E7D; Mon, 4 Jun 2018 15:26:34 +0800 (CST) Received: from slw.lan (10.167.226.95) by G08CNEXCHPEKD03.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.399.0; Mon, 4 Jun 2018 15:26:37 +0800 From: Sun Lianwen To: Date: Mon, 4 Jun 2018 15:27:31 +0800 Message-ID: <20180604072731.5409-1-sunlw.fnst@cn.fujitsu.com> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 X-Originating-IP: [10.167.226.95] X-yoursite-MailScanner-ID: C37E64B41E7D.A3544 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: sunlw.fnst@cn.fujitsu.com X-Spam-Status: No, score=0.0 required=7.0 tests=none autolearn=disabled version=3.4.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-4.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-4.smtp.seeweb.it Cc: ltp@lists.linux.it Subject: [LTP] [PATCH] sctp: change the layout of tst_brkm() X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" The statement tst_brkm(TBROK, tst_exit, "a b" "c"); which will error output "a bc", and this layout do not good for git grep. Reported-by: Wei Xingshen Signed-off-by: Sun Lianwen --- utils/sctp/testlib/sctputil.c | 71 +++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 32 deletions(-) diff --git a/utils/sctp/testlib/sctputil.c b/utils/sctp/testlib/sctputil.c index 564925ce9..d1a1ae988 100644 --- a/utils/sctp/testlib/sctputil.c +++ b/utils/sctp/testlib/sctputil.c @@ -185,29 +185,29 @@ test_check_buf_notification(void *buf, int datalen, int msg_flags, union sctp_notification *sn; if (!(msg_flags & MSG_NOTIFICATION)) - tst_brkm(TBROK, tst_exit, "Got a datamsg, expecting " - "notification"); + tst_brkm(TBROK, tst_exit, + "Got a datamsg, expecting notification"); if (expected_datalen <= 0) return; if (datalen != expected_datalen) - tst_brkm(TBROK, tst_exit, "Got a notification of unexpected " - "length:%d, expected length:%d", datalen, - expected_datalen); + tst_brkm(TBROK, tst_exit, + "Got a notification of unexpected length:%d, expected length:%d", + datalen, expected_datalen); sn = (union sctp_notification *)buf; if (sn->sn_header.sn_type != expected_sn_type) - tst_brkm(TBROK, tst_exit, "Unexpected notification:%d" - "expected:%d", sn->sn_header.sn_type, - expected_sn_type); + tst_brkm(TBROK, tst_exit, + "Unexpected notification:%d expected:%d", + sn->sn_header.sn_type, expected_sn_type); switch(sn->sn_header.sn_type){ case SCTP_ASSOC_CHANGE: if (sn->sn_assoc_change.sac_state != expected_additional) - tst_brkm(TBROK, tst_exit, "Unexpected sac_state:%d " - "expected:%d", sn->sn_assoc_change.sac_state, - expected_additional); + tst_brkm(TBROK, tst_exit, + "Unexpected sac_state:%d expected:%d", + sn->sn_assoc_change.sac_state, expected_additional); break; default: break; @@ -237,35 +237,38 @@ test_check_buf_data(void *buf, int datalen, int msg_flags, uint32_t expected_ppid) { if (msg_flags & MSG_NOTIFICATION) - tst_brkm(TBROK, tst_exit, "Got a notification, expecting a" - "datamsg"); + tst_brkm(TBROK, tst_exit, + "Got a notification, expecting a datamsg"); if (expected_datalen <= 0) return; if (datalen != expected_datalen) - tst_brkm(TBROK, tst_exit, "Got a datamsg of unexpected " - "length:%d, expected length:%d", datalen, - expected_datalen); + tst_brkm(TBROK, tst_exit, + "Got a datamsg of unexpected length:%d, expected length:%d", + datalen, expected_datalen); if ((msg_flags & ~0x80000000) != expected_msg_flags) - tst_brkm(TBROK, tst_exit, "Unexpected msg_flags:0x%x " - "expecting:0x%x", msg_flags, expected_msg_flags); + tst_brkm(TBROK, tst_exit, + "Unexpected msg_flags:0x%x expecting:0x%x", + msg_flags, expected_msg_flags); if ((0 == expected_stream) && (0 == expected_ppid)) return; if (!sinfo) - tst_brkm(TBROK, tst_exit, "Null sinfo, but expected " - "stream:%d expected ppid:%d", expected_stream, - expected_ppid); + tst_brkm(TBROK, tst_exit, + "Null sinfo, but expected stream:%d expected ppid:%d", + expected_stream, expected_ppid); if (sinfo->sinfo_stream != expected_stream) - tst_brkm(TBROK, tst_exit, "stream mismatch: expected:%x " - "got:%x", expected_stream, sinfo->sinfo_stream); + tst_brkm(TBROK, tst_exit, + "stream mismatch: expected:%x got:%x", + expected_stream, sinfo->sinfo_stream); if (sinfo->sinfo_ppid != expected_ppid) - tst_brkm(TBROK, tst_exit, "ppid mismatch: expected:%x " - "got:%x\n", expected_ppid, sinfo->sinfo_ppid); + tst_brkm(TBROK, tst_exit, + "ppid mismatch: expected:%x got:%x\n", + expected_ppid, sinfo->sinfo_ppid); } /* Check if a message corresponds to data, its length, msg_flags, stream and @@ -356,8 +359,8 @@ static int cmp_addr(sockaddr_storage_t *addr1, sockaddr_storage_t *addr2) return memcmp(&addr1->v4.sin_addr, &addr2->v4.sin_addr, sizeof(addr1->v4.sin_addr)); default: - tst_brkm(TBROK, tst_exit, "invalid address type %d", - addr1->sa.sa_family); + tst_brkm(TBROK, tst_exit, + "invalid address type %d", addr1->sa.sa_family); return -1; } } @@ -375,13 +378,15 @@ int test_peer_addr(int sk, sctp_assoc_t asoc, sockaddr_storage_t *peers, int cou error = sctp_getpaddrs(sk, asoc, &addrs); if (-1 == error) { - tst_brkm(TBROK, tst_exit, "sctp_getpaddrs: %s", strerror(errno)); + tst_brkm(TBROK, tst_exit, + "sctp_getpaddrs: %s", strerror(errno)); return error; } if (error != count) { sctp_freepaddrs(addrs); - tst_brkm(TBROK, tst_exit, "peer count %d mismatch, expected %d", - error, count); + tst_brkm(TBROK, tst_exit, + "peer count %d mismatch, expected %d", + error, count); } addrbuf = addrs; for (i = 0; i < count; i++) { @@ -398,7 +403,8 @@ int test_peer_addr(int sk, sctp_assoc_t asoc, sockaddr_storage_t *peers, int cou default: errno = EINVAL; sctp_freepaddrs(addrs); - tst_brkm(TBROK, tst_exit, "sctp_getpaddrs: %s", strerror(errno)); + tst_brkm(TBROK, tst_exit, + "sctp_getpaddrs: %s", strerror(errno)); return -1; } for (j = 0; j < count; j++) { @@ -410,7 +416,8 @@ int test_peer_addr(int sk, sctp_assoc_t asoc, sockaddr_storage_t *peers, int cou } for (j = 0; j < count; j++) { if (found[j] == 0) { - tst_brkm(TBROK, tst_exit, "peer address %d not found", j); + tst_brkm(TBROK, tst_exit, + "peer address %d not found", j); } } sctp_freepaddrs(addrs);