From patchwork Thu Jul 14 16:05:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avinesh Kumar X-Patchwork-Id: 1656523 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=W3vlXLfB; dkim=fail reason="signature verification failed" header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=cNT96YvP; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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=) Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LkK8M6xprz9ryY for ; Fri, 15 Jul 2022 02:05:23 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id B7A513CAA05 for ; Thu, 14 Jul 2022 18:05:20 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [217.194.8.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 45D493CA9DD for ; Thu, 14 Jul 2022 18:05:19 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-7.smtp.seeweb.it (Postfix) with ESMTPS id 9A22A200D13 for ; Thu, 14 Jul 2022 18:05:18 +0200 (CEST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 9733234CE0 for ; Thu, 14 Jul 2022 16:05:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1657814717; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=u3NIZtenpyfp3a53U9O9+J9xFMppiUhK+sp3vzGAv3c=; b=W3vlXLfBJf8OG9QrWMKnSdhdv7ZgWQLi4Z0hW0E9f35DPsoXgTZw8fCFe90z2fqxl+TZ60 tN6klAACfG7cwwi0wt3C5Pqpoot5/YdoEZsHe53NywzXQTRr5I6IHRaTa+96D445OoBqQh ePOfBfnOv9vUNn94DXXxhOw/LJpAwlA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1657814717; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=u3NIZtenpyfp3a53U9O9+J9xFMppiUhK+sp3vzGAv3c=; b=cNT96YvPFBK6yzZtDsbWkJNRPaofZY0SlSqIpJif0NSbExF5AP0poO+ZPiPKVUh/z4zFTz OfueEAXrVeoHfBBg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 150F4133A6 for ; Thu, 14 Jul 2022 16:05:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 2gLXMbw+0GLJWwAAMHmgww (envelope-from ) for ; Thu, 14 Jul 2022 16:05:16 +0000 From: Avinesh Kumar To: ltp@lists.linux.it Date: Thu, 14 Jul 2022 21:35:14 +0530 Message-Id: <20220714160514.21062-1-akumar@suse.de> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-7.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-7.smtp.seeweb.it Subject: [LTP] [PATCH] write04.c: use TST_EXP_FAIL() macro X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 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" Signed-off-by: Avinesh Kumar --- testcases/kernel/syscalls/write/write04.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/testcases/kernel/syscalls/write/write04.c b/testcases/kernel/syscalls/write/write04.c index a765d91b7..565fddfb7 100644 --- a/testcases/kernel/syscalls/write/write04.c +++ b/testcases/kernel/syscalls/write/write04.c @@ -30,20 +30,7 @@ static void verify_write(void) { char wbuf[8 * page_size]; - TEST(write(wfd, wbuf, sizeof(wbuf))); - - if (TST_RET != -1) { - tst_res(TFAIL, "write() succeeded unexpectedly"); - return; - } - - if (TST_ERR != EAGAIN) { - tst_res(TFAIL | TTERRNO, - "write() failed unexpectedly, expected EAGAIN"); - return; - } - - tst_res(TPASS | TTERRNO, "write() failed expectedly"); + TST_EXP_FAIL(write(wfd, wbuf, sizeof(wbuf)), EAGAIN); } static void setup(void)