From: Andrea Cervesato <andrea.cervesato@suse.de>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 2/5] Fix TST_EXP_EXTR() stringification
Date: Tue, 02 Jul 2024 16:12:48 +0200 [thread overview]
Message-ID: <20240702-stat04-v1-2-e27d9953210d@suse.com> (raw)
In-Reply-To: <20240702-stat04-v1-0-e27d9953210d@suse.com>
From: Andrea Cervesato <andrea.cervesato@suse.com>
Follow the TST_* macros standards when it comes to stringification of
the expressions.
Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
include/tst_test_macros.h | 5 +++--
testcases/kernel/syscalls/fork/fork04.c | 6 +++---
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/include/tst_test_macros.h b/include/tst_test_macros.h
index 22b39fb14..7a443c803 100644
--- a/include/tst_test_macros.h
+++ b/include/tst_test_macros.h
@@ -340,8 +340,9 @@ const char *tst_errno_names(char *buf, const int *exp_errs, int exp_errs_cnt);
&tst_exp_err__, 1, ##__VA_ARGS__); \
} while (0)
-#define TST_EXP_EXPR(EXPR, FMT, ...) \
- tst_res_(__FILE__, __LINE__, (EXPR) ? TPASS : TFAIL, "Expect: " FMT, ##__VA_ARGS__);
+#define TST_EXP_EXPR(EXPR, ...) \
+ tst_res_(__FILE__, __LINE__, (EXPR) ? TPASS : TFAIL, "Expect: " \
+ TST_FMT_(TST_2_(dummy, ##__VA_ARGS__, #EXPR), __VA_ARGS__));
#define TST_EXP_EQ_(VAL_A, SVAL_A, VAL_B, SVAL_B, TYPE, PFS) do {\
TYPE tst_tmp_a__ = VAL_A; \
diff --git a/testcases/kernel/syscalls/fork/fork04.c b/testcases/kernel/syscalls/fork/fork04.c
index b0c6bebe0..413cd5eb4 100644
--- a/testcases/kernel/syscalls/fork/fork04.c
+++ b/testcases/kernel/syscalls/fork/fork04.c
@@ -29,7 +29,7 @@ static void run_child(void)
TST_EXP_EXPR(strcmp(ENV_VAL0, val) == 0,
"%s environ variable has been inherited by the child",
- ENV_KEY)
+ ENV_KEY);
tst_res(TINFO, "Unset %s environ variable inside child", ENV_KEY);
@@ -72,7 +72,7 @@ static void run(void)
} else {
TST_EXP_EXPR(strcmp(ENV_VAL0, val) == 0,
"%s environ variable is still present inside parent",
- ENV_KEY)
+ ENV_KEY);
}
TST_CHECKPOINT_WAKE_AND_WAIT(0);
@@ -85,7 +85,7 @@ static void run(void)
else {
TST_EXP_EXPR(strcmp(ENV_VAL0, val) == 0,
"%s environ variable didn't change inside parent",
- ENV_KEY)
+ ENV_KEY);
}
}
--
2.43.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2024-07-02 14:13 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-02 14:12 [LTP] [PATCH 0/5] symlink01 split Andrea Cervesato
2024-07-02 14:12 ` [LTP] [PATCH 1/5] Add stat04 test Andrea Cervesato
2024-07-04 7:06 ` Li Wang
2024-07-04 9:17 ` Cyril Hrubis
2024-07-04 9:23 ` Cyril Hrubis
2024-07-04 11:27 ` Li Wang
2024-07-04 11:55 ` Cyril Hrubis
2024-07-04 12:02 ` Li Wang
2024-07-02 14:12 ` Andrea Cervesato [this message]
2024-07-04 7:11 ` [LTP] [PATCH 2/5] Fix TST_EXP_EXTR() stringification Li Wang
2024-07-04 9:19 ` Cyril Hrubis
2024-07-02 14:12 ` [LTP] [PATCH 3/5] Add lstat03 test Andrea Cervesato
2024-07-04 6:36 ` Li Wang
2024-07-04 6:56 ` Li Wang
2024-07-02 14:12 ` [LTP] [PATCH 4/5] Add chmod08 test Andrea Cervesato
2024-07-04 7:12 ` Li Wang
2024-07-02 14:12 ` [LTP] [PATCH 5/5] Add open15 test Andrea Cervesato
2024-07-04 7:18 ` Li Wang
2024-07-04 7:32 ` Li Wang
2024-07-09 10:31 ` Andrea Cervesato via ltp
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=20240702-stat04-v1-2-e27d9953210d@suse.com \
--to=andrea.cervesato@suse.de \
--cc=ltp@lists.linux.it \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox