<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 21, 2022 at 7:51 PM Avinesh Kumar <<a href="mailto:akumar@suse.de">akumar@suse.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Signed-off-by: Avinesh Kumar <<a href="mailto:akumar@suse.de" target="_blank">akumar@suse.de</a>><br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">Merged, thanks!</div><div class="gmail_default" style="font-size:small"></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
.../kernel/syscalls/getrlimit/getrlimit02.c | 27 ++++++++-----------<br>
1 file changed, 11 insertions(+), 16 deletions(-)<br>
<br>
diff --git a/testcases/kernel/syscalls/getrlimit/getrlimit02.c b/testcases/kernel/syscalls/getrlimit/getrlimit02.c<br>
index 586ca5a67..9b68ce20b 100644<br>
--- a/testcases/kernel/syscalls/getrlimit/getrlimit02.c<br>
+++ b/testcases/kernel/syscalls/getrlimit/getrlimit02.c<br>
@@ -18,33 +18,28 @@<br>
#include <sys/resource.h><br>
#include "tst_test.h"<br>
<br>
-#define RLIMIT_TOO_HIGH 1000<br>
+#define INVALID_RES_TYPE 1000<br>
<br>
static struct rlimit rlim;<br>
<br>
static struct tcase {<br>
- int exp_errno; /* Expected error no */<br>
- char *exp_errval; /* Expected error value string */<br>
- struct rlimit *rlim; /* rlimit structure */<br>
- int res_type; /* resource type */<br>
+ int exp_errno;<br>
+ char *desc;<br>
+ struct rlimit *rlim;<br>
+ int res_type;<br>
} tcases[] = {<br>
- { EINVAL, "EINVAL", &rlim, RLIMIT_TOO_HIGH}<br>
+ {EFAULT, "invalid address", (void *)-1, RLIMIT_CORE},<br>
+ {EINVAL, "invalid resource type", &rlim, INVALID_RES_TYPE}<br>
};<br>
<br>
static void verify_getrlimit(unsigned int i)<br>
{<br>
struct tcase *tc = &tcases[i];<br>
<br>
- TEST(getrlimit(tc->res_type, tc->rlim));<br>
-<br>
- if ((TST_RET == -1) && (TST_ERR == tc->exp_errno)) {<br>
- tst_res(TPASS, "expected failure; got %s",<br>
- tc->exp_errval);<br>
- } else {<br>
- tst_res(TFAIL, "call failed to produce "<br>
- "expected error; errno: %d : %s",<br>
- TST_ERR, strerror(TST_ERR));<br>
- }<br>
+ TST_EXP_FAIL(getrlimit(tc->res_type, tc->rlim),<br>
+ tc->exp_errno,<br>
+ "getrlimit() with %s",<br>
+ tc->desc);<br>
}<br>
<br>
static struct tst_test test = {<br>
-- <br>
2.38.1<br>
<br>
<br>
-- <br>
Mailing list info: <a href="https://lists.linux.it/listinfo/ltp" rel="noreferrer" target="_blank">https://lists.linux.it/listinfo/ltp</a><br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>