public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v1] Add test descriptions to ioctl01.c
@ 2023-09-11 11:40 Marius Kittler
  2023-09-11 13:43 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Marius Kittler @ 2023-09-11 11:40 UTC (permalink / raw)
  To: ltp

Signed-off-by: Marius Kittler <mkittler@suse.de>
---
 testcases/kernel/syscalls/ioctl/ioctl01.c | 26 ++++++++++-------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/testcases/kernel/syscalls/ioctl/ioctl01.c b/testcases/kernel/syscalls/ioctl/ioctl01.c
index 3ca8a9a3b..d194bbc24 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl01.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl01.c
@@ -35,28 +35,24 @@ static struct termio termio;
 static struct termios termios;
 
 static struct tcase {
+	const char *desc;
 	int *fd;
 	int request;
 	void *s_tio;
 	int error;
 } tcases[] = {
-	/* file descriptor is invalid */
-	{&bfd, TCGETA, &termio, EBADF},
-	{&bfd, TCGETS, &termios, EBADF},
-	/* termio address is invalid */
-	{&fd, TCGETA, (struct termio *)-1, EFAULT},
-	{&fd, TCGETS, (struct termios *)-1, EFAULT},
-	// /* command is invalid */
+	{"File descriptor is invalid (termio)", &bfd, TCGETA, &termio, EBADF},
+	{"File descriptor is invalid (termios)", &bfd, TCGETS, &termios, EBADF},
+	{"Termio address is invalid", &fd, TCGETA, (struct termio *)-1, EFAULT},
+	{"Termios address is invalid", &fd, TCGETS, (struct termios *)-1, EFAULT},
 	/* This errno value was changed from EINVAL to ENOTTY
 	 * by kernel commit 07d106d0 and bbb63c51
 	 */
-	{&fd, INVAL_IOCTL, &termio, ENOTTY},
-	/* file descriptor is for a regular file */
-	{&fd_file, TCGETA, &termio, ENOTTY},
-	{&fd_file, TCGETS, &termios, ENOTTY},
-	/* termio is NULL */
-	{&fd, TCGETA, NULL, EFAULT},
-	{&fd, TCGETS, NULL, EFAULT}
+	{"Command is invalid", &fd, INVAL_IOCTL, &termio, ENOTTY},
+	{"File descriptor is for a regular file (termio)", &fd_file, TCGETA, &termio, ENOTTY},
+	{"File descriptor is for a regular file (termios)", &fd_file, TCGETS, &termios, ENOTTY},
+	{"Termio is NULL", &fd, TCGETA, NULL, EFAULT},
+	{"Termios is NULL", &fd, TCGETS, NULL, EFAULT}
 };
 
 static char *device;
@@ -64,7 +60,7 @@ static char *device;
 static void verify_ioctl(unsigned int i)
 {
 	TST_EXP_FAIL(ioctl(*(tcases[i].fd), tcases[i].request, tcases[i].s_tio),
-		     tcases[i].error);
+		     tcases[i].error, "%s", tcases[i].desc);
 }
 
 static void setup(void)
-- 
2.42.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [LTP] [PATCH v1] Add test descriptions to ioctl01.c
  2023-09-11 11:40 [LTP] [PATCH v1] Add test descriptions to ioctl01.c Marius Kittler
@ 2023-09-11 13:43 ` Cyril Hrubis
  0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2023-09-11 13:43 UTC (permalink / raw)
  To: Marius Kittler; +Cc: ltp

Hi!
Applied, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-09-11 13:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-11 11:40 [LTP] [PATCH v1] Add test descriptions to ioctl01.c Marius Kittler
2023-09-11 13:43 ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox