From: Andrea Cervesato <andrea.cervesato@suse.de>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2 2/5] Fix TST_EXP_EXTR() stringification
Date: Tue, 09 Jul 2024 12:45:32 +0200 [thread overview]
Message-ID: <20240709-stat04-v2-2-2693a473a2ab@suse.com> (raw)
In-Reply-To: <20240709-stat04-v2-0-2693a473a2ab@suse.com>
From: Andrea Cervesato <andrea.cervesato@suse.com>
Follow the TST_* macros standards when it comes to stringification of
the expressions.
Reviewed-by: Li Wang <liwang@redhat.com>
Suggested-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
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-09 10:46 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-09 10:45 [LTP] [PATCH v2 0/5] symlink01 split Andrea Cervesato
2024-07-09 10:45 ` [LTP] [PATCH v2 1/5] Add stat04 test Andrea Cervesato
2024-07-09 21:13 ` Petr Vorel
2024-07-10 8:17 ` Andrea Cervesato via ltp
2024-07-10 10:38 ` Petr Vorel
2024-07-10 12:29 ` Cyril Hrubis
2024-07-09 10:45 ` Andrea Cervesato [this message]
2024-07-09 12:48 ` [LTP] [PATCH v2 2/5] Fix TST_EXP_EXTR() stringification Petr Vorel
2024-07-09 12:52 ` Li Wang
2024-07-09 10:45 ` [LTP] [PATCH v2 3/5] Add lstat03 test Andrea Cervesato
2024-07-09 11:59 ` Li Wang
2024-07-09 10:45 ` [LTP] [PATCH v2 4/5] Add chmod08 test Andrea Cervesato
2024-07-09 10:45 ` [LTP] [PATCH v2 5/5] Add open15 test Andrea Cervesato
2024-07-09 12:14 ` Li Wang
2024-07-10 7:29 ` 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=20240709-stat04-v2-2-2693a473a2ab@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