Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine format of result lines #135

Merged
merged 2 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions common/kselftest.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,11 @@ static inline void ksft_test_result_pass(const char *msg, ...)
ksft_cnt.ksft_pass++;

va_start(args, msg);
printf("ok %d ", ksft_test_num());
printf("%d: ", ksft_test_num());
errno = saved_errno;
vprintf(msg, args);
va_end(args);
printf(": [PASS]\n");
}

static inline void ksft_test_result_fail(const char *msg, ...)
Expand All @@ -166,10 +167,11 @@ static inline void ksft_test_result_fail(const char *msg, ...)
ksft_cnt.ksft_fail++;

va_start(args, msg);
printf("not ok %d ", ksft_test_num());
printf("%d: ", ksft_test_num());
errno = saved_errno;
vprintf(msg, args);
va_end(args);
printf(": [FAIL]\n");
}

/**
Expand Down
8 changes: 4 additions & 4 deletions xsave/xstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ static void compare_buf_result(struct xsave_buffer *valid_buf,
const char *case_name)
{
if (memcmp(&valid_buf->bytes[0], &compare_buf->bytes[0], xstate_size))
ksft_test_result_fail("The case: %s.\n", case_name);
ksft_test_result_fail("%s", case_name);
else
ksft_test_result_pass("The case: %s.\n", case_name);
ksft_test_result_pass("%s", case_name);
}

static void test_xstate_sig_handle(void)
Expand Down Expand Up @@ -132,9 +132,9 @@ static void test_xstate_fork(void)
/* Child process xstate should be same as the parent process xstate. */
if (xstate_fork(valid_xbuf, compared_xbuf, xstate_info.mask,
xstate_size)) {
ksft_test_result_pass("The case: %s.\n", case_name2);
ksft_test_result_pass("%s", case_name2);
} else {
ksft_test_result_fail("The case: %s.\n", case_name2);
ksft_test_result_fail("%s", case_name2);
}

/* The parent process xstate should not change after context switch. */
Expand Down
Loading