syscalls/prctl: Use TST_ASSERT_STR/INT
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
diff --git a/testcases/kernel/syscalls/prctl/prctl05.c b/testcases/kernel/syscalls/prctl/prctl05.c
index 1f97900..ae390fd 100644
--- a/testcases/kernel/syscalls/prctl/prctl05.c
+++ b/testcases/kernel/syscalls/prctl/prctl05.c
@@ -28,18 +28,6 @@
{"prctl05_test_xxxxx", "prctl05_test_xx"}
};
-static void check_proc_comm(char *path, char *name)
-{
- char comm_buf[20];
-
- SAFE_FILE_SCANF(path, "%s", comm_buf);
- if (strcmp(name, comm_buf))
- tst_res(TFAIL,
- "%s has %s, expected %s", path, comm_buf, name);
- else
- tst_res(TPASS, "%s sets to %s", path, comm_buf);
-}
-
static void verify_prctl(unsigned int n)
{
char buf[20];
@@ -71,9 +59,8 @@
tid = tst_syscall(__NR_gettid);
sprintf(comm_path, "/proc/self/task/%d/comm", tid);
- check_proc_comm(comm_path, tc->expname);
-
- check_proc_comm("/proc/self/comm", tc->expname);
+ TST_ASSERT_STR(comm_path, tc->expname);
+ TST_ASSERT_STR("/proc/self/comm", tc->expname);
}
static struct tst_test test = {
diff --git a/testcases/kernel/syscalls/prctl/prctl08.c b/testcases/kernel/syscalls/prctl/prctl08.c
index fd8ccb6..9a1b34c 100644
--- a/testcases/kernel/syscalls/prctl/prctl08.c
+++ b/testcases/kernel/syscalls/prctl/prctl08.c
@@ -53,19 +53,6 @@
check_get_timerslack(message, origin_value);
}
-static void check_proc_timerslack(char *message, unsigned long value)
-{
- unsigned long proc_value;
-
- SAFE_FILE_SCANF(PROC_TIMERSLACK_PATH, "%lu", &proc_value);
- if (proc_value == value)
- tst_res(TPASS, "%s %s got %lu expectedly",
- message, PROC_TIMERSLACK_PATH, proc_value);
- else
- tst_res(TFAIL, "%s %s expected %lu got %lu",
- message, PROC_TIMERSLACK_PATH, value, proc_value);
-}
-
static void check_get_timerslack(char *message, unsigned long value)
{
TEST(prctl(PR_GET_TIMERSLACK));
@@ -77,8 +64,7 @@
message, value, TST_RET);
if (proc_flag)
- check_proc_timerslack(message, value);
-
+ TST_ASSERT_INT(PROC_TIMERSLACK_PATH, value);
}
static void check_inherit_timerslack(char *message, unsigned long value)