[PATCH] [RFC/PATCH] Add test case for loop.c

Dhanuka Warusadura csx at disroot.org
Thu Mar 26 06:28:19 UTC 2020


This patch adds a test case for loop.c. Currently loop.c has 97.6%
covered and this patch intend complete the rest.

Signed-off-by: Dhanuka Warusadura <csx at disroot.org>
---
 loop.c             | 3 ++-
 tests/ioctl_loop.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/loop.c b/loop.c
index 36a40c55..0afda70f 100644
--- a/loop.c
+++ b/loop.c
@@ -69,7 +69,8 @@ decode_loop_info(struct tcb *const tcp, const kernel_ulong_t addr)
 	}
 
 	if (!abbrev(tcp))
-		tprintf(", lo_init=[%#" PRI_klx ", %#" PRI_klx "]"
+		tprintf(", lo_init=[%#" PRI_klx ", %#" PRI_klx ", \
+                %#" PRI_klx ", %#" PRI_klx "]"
 			", reserved=[%#hhx, %#hhx, %#hhx, %#hhx]}",
 			(kernel_ulong_t) info.lo_init[0],
 			(kernel_ulong_t) info.lo_init[1],
diff --git a/tests/ioctl_loop.c b/tests/ioctl_loop.c
index 61300e90..3ded79b1 100644
--- a/tests/ioctl_loop.c
+++ b/tests/ioctl_loop.c
@@ -82,9 +82,10 @@ print_loop_info(struct loop_info * const info, bool print_encrypt,
 		       (char *) info->lo_encrypt_key);
 
 # if VERBOSE
-	printf(", lo_init=[%#lx, %#lx]"
+	printf(", lo_init=[%#lx, %#lx, %#lx, %#lx]"
 	       ", reserved=[%#hhx, %#hhx, %#hhx, %#hhx]}",
 	       info->lo_init[0], info->lo_init[1],
+           info->lo_init[2], info->lo_init[3],
 	       info->reserved[0], info->reserved[1],
 	       info->reserved[2], info->reserved[3]);
 # else /* !VERBOSE */
-- 
2.25.1



More information about the Strace-devel mailing list