[RFC/PATCH] tests/syslog: GSOC Microproject: Extend coverage of syslog tests

Bharath Vedartham linux.bhar at gmail.com
Thu Feb 28 12:51:13 UTC 2019


The current syslog test covers only cases where the type parameter is
SYSLOG_ACTION_READ, SYSLOG_ACTION_READ_ALL, SYSLOG_ACTION_READ_CLEAR as
per codecov.

Add test case to cover rest of the default cases.

PS: I am looking to apply for Gsoc. This is my first patch to strace.
---
 tests/syslog.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/syslog.c b/tests/syslog.c
index 363fdf9..00b8245 100644
--- a/tests/syslog.c
+++ b/tests/syslog.c
@@ -14,15 +14,21 @@
 # include <unistd.h>
 
 # define SYSLOG_ACTION_READ 2
+# define SYSLOG_ACTION_SIZE_BUFFER 10
 
 int
 main(void)
 {
 	const long addr = (long) 0xfacefeeddeadbeefULL;
+
 	int rc = syscall(__NR_syslog, SYSLOG_ACTION_READ, addr, -1);
 	printf("syslog(SYSLOG_ACTION_READ, %#lx, -1) = %d %s (%m)\n",
 	       addr, rc, errno2name());
 
+	rc = syscall(__NR_syslog, SYSLOG_ACTION_SIZE_BUFFER, NULL, 10);
+	printf("syslog(SYSLOG_ACTION_SIZE_BUFFER, NULL, 10) = %d\n",
+			               rc);
+
 	puts("+++ exited with 0 +++");
 	return 0;
 }
-- 
2.7.4



More information about the Strace-devel mailing list