setregid01.c: Turn comment into docparse format and use TST_EXP_PASS macro
PATCH 1/1 setregid01.c: Turn comment into docparse format and use TST_EXP_PASS macro
Signed-off-by Avinesh Kumar <[email protected]>
--- .../kernel/syscalls/setregid/setregid01.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-)
testcases/kernel/syscalls/setregid/setregid01.c +8 -11
@@ -15,14 +15,16 @@* Co-pilot: Dave Fenner */ -/* -* Testcase to test the basic functionality of setregid(2) systemm call. +/*\ +* [Description] +* +* Verify the basic functionality of setregid(2) system call. */ #include "tst_test.h" #include "compat_tst_16.h" -static gid_t gid, egid;/* current real and effective group id */ +static gid_t gid, egid;static gid_t neg_one =-1 ; static struct tcase {
@@ -30,23 +32,18 @@ static struct tcase {gid_t *arg2;const char *msg; } tcases[] = { - {&neg_one, &neg_one, "Dont change either real or effective gid" }, + {&neg_one, &neg_one, "Leave real and effective both gids unchanged" }, {&neg_one, &egid, "Change effective to effective gid" }, {&gid, &neg_one, "Change real to real gid" }, {&neg_one, &gid, "Change effective to real gid" }, - {&gid, &gid, "Try to change real to current real" } + {&gid, &gid, "Change real and effective both gids to current real gid" } }; static void run(unsigned int n) { struct tcase *tc = &tcases[n]; - TEST(SETREGID(*tc->arg1, *tc->arg2)); - - if (TST_RET == -1) - tst_res(TFAIL | TTERRNO, "%s", tc->msg); - else - tst_res(TPASS, "%s", tc->msg); + TST_EXP_PASS(SETREGID(*tc->arg1, *tc->arg2), "%s:", tc->msg); } static void setup(void)
Signature · 5 lines
2.39.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Richard Palethorpe
AppliedHello,
Merged, thanks!
Quoted 58 lines · Avinesh Kumar
Signed-off-by Avinesh Kumar <[email protected]>--- .../kernel/syscalls/setregid/setregid01.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-)testcases/kernel/syscalls/setregid/setregid01.c +8
-11@@ -15,14 +15,16 @@* Co-pilot: Dave Fenner */ -/* -* Testcase to test the basic functionality of setregid(2) systemm call. +/*\ +* [Description] +* +* Verify the basic functionality of setregid(2) system call. */ #include "tst_test.h" #include "compat_tst_16.h" -static gid_t gid, egid;/* current real and effective group id */ +static gid_t gid, egid;static gid_t neg_one =-1 ; static struct tcase {@@ -30,23 +32,18 @@ static struct tcase {gid_t *arg2;const char *msg; } tcases[] = { - {&neg_one, &neg_one, "Dont change either real or effective gid" }, + {&neg_one, &neg_one, "Leave real and effective both gids unchanged" }, {&neg_one, &egid, "Change effective to effective gid" }, {&gid, &neg_one, "Change real to real gid" }, {&neg_one, &gid, "Change effective to real gid" }, - {&gid, &gid, "Try to change real to current real" } + {&gid, &gid, "Change real and effective both gids to current real gid" } }; static void run(unsigned int n) { struct tcase *tc = &tcases[n]; - TEST(SETREGID(*tc->arg1, *tc->arg2)); - - if (TST_RET == -1) - tst_res(TFAIL | TTERRNO, "%s", tc->msg); - else - tst_res(TPASS, "%s", tc->msg); + TST_EXP_PASS(SETREGID(*tc->arg1, *tc->arg2), "%s:", tc->msg); } static void setup(void)Signature · 1 line
2.39.0
Signature · 5 lines
Thank you, Richard. -- Mailing list info: https://lists.linux.it/listinfo/ltp