All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Palethorpe via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it
Cc: Richard Palethorpe <rpalethorpe@suse.com>
Subject: [LTP] [PATCH v3 4/5] API: Add TST_EXP_EXPR macro
Date: Tue,  4 Jan 2022 12:20:09 +0000	[thread overview]
Message-ID: <20220104122010.23069-4-rpalethorpe@suse.com> (raw)
In-Reply-To: <20220104122010.23069-1-rpalethorpe@suse.com>

Simplifies evaluating an arbitrary expression or statement which is
not a syscall.

Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
---
 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

  parent reply	other threads:[~2022-01-04 12:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-04 12:20 [LTP] [PATCH v3 1/5] API/cgroup: Add safe_cgroup_lines_scanf Richard Palethorpe via ltp
2022-01-04 12:20 ` [LTP] [PATCH v3 2/5] API/cgroup: Add memory.stat Richard Palethorpe via ltp
2022-01-04 12:20 ` [LTP] [PATCH v3 3/5] API/fs: Add exfat magic Richard Palethorpe via ltp
2022-01-04 14:20   ` Cyril Hrubis
2022-01-04 12:20 ` Richard Palethorpe via ltp [this message]
2022-01-04 14:25   ` [LTP] [PATCH v3 4/5] API: Add TST_EXP_EXPR macro Cyril Hrubis
2022-01-04 12:20 ` [LTP] [PATCH v3 5/5] cgroup: Add memcontrol02 Richard Palethorpe via ltp
2022-01-04 15:02   ` Cyril Hrubis
2022-01-04 15:26     ` Richard Palethorpe
2022-01-05  5:12       ` Richard Palethorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220104122010.23069-4-rpalethorpe@suse.com \
    --to=ltp@lists.linux.it \
    --cc=rpalethorpe@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.