From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 94990C433F5 for ; Tue, 4 Jan 2022 12:21:07 +0000 (UTC) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 9FC213C9073 for ; Tue, 4 Jan 2022 13:21:05 +0100 (CET) Received: from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [IPv6:2001:4b78:1:20::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 07F863C2A4D for ; Tue, 4 Jan 2022 13:20:37 +0100 (CET) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (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 9C78C200224 for ; Tue, 4 Jan 2022 13:20:36 +0100 (CET) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 3BACB212BD; Tue, 4 Jan 2022 12:20:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1641298836; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=urqIU9LZWt+RSQOk+rkNVQ7hWLKQKIPOFHYmB/NqHCk=; b=EQek/TUtVAxZjNdKmJJ+tSR39J3SDQd1s7sV0BirJmeGaJWn4e/YWhv+lynZZsjSPke5f6 2HYKnvS1Rlyf9cFzsXlnpRL70caxkoPB8kNV06W1O1R46lm0KYC99jVpZFrWs+DXC6opmJ P2PRyybVe4H/WK71X6Fyn/McZe+4EK4= Received: from g78.suse.de (unknown [10.163.24.42]) by relay2.suse.de (Postfix) with ESMTP id 037B0A3B84; Tue, 4 Jan 2022 12:20:35 +0000 (UTC) To: ltp@lists.linux.it Date: Tue, 4 Jan 2022 12:20:09 +0000 Message-Id: <20220104122010.23069-4-rpalethorpe@suse.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220104122010.23069-1-rpalethorpe@suse.com> References: <20220104122010.23069-1-rpalethorpe@suse.com> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-7.smtp.seeweb.it X-Virus-Status: Clean Subject: [LTP] [PATCH v3 4/5] API: Add TST_EXP_EXPR 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: , From: Richard Palethorpe via ltp Reply-To: Richard Palethorpe Cc: Richard Palethorpe Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-bounces+ltp=archiver.kernel.org@lists.linux.it Sender: "ltp" Simplifies evaluating an arbitrary expression or statement which is not a syscall. Signed-off-by: Richard Palethorpe --- include/tst_test_macros.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/tst_test_macros.h b/include/tst_test_macros.h index 5dea1aabd..ec8c38523 100644 --- a/include/tst_test_macros.h +++ b/include/tst_test_macros.h @@ -195,4 +195,7 @@ extern void *TST_RET_PTR; #define TST_EXP_FAIL2(SCALL, ERRNO, ...) TST_EXP_FAIL_(TST_RET >= 0, SCALL, #SCALL, ERRNO, ##__VA_ARGS__) +#define TST_EXP_EXPR(EXPR, FMT, ...) \ + tst_res_(__FILE__, __LINE__, (EXPR) ? TPASS : TFAIL, "Expect: " FMT, ##__VA_ARGS__); + #endif /* TST_TEST_MACROS_H__ */ -- 2.34.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp