mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
selftest/bpf: Extend the bpf_snprintf() test for "%c".
This patch adds various "positive" patterns for "%c" and two "negative" patterns for wide character. Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20210814015718.42704-5-kuniyu@amazon.co.jp
This commit is contained in:
committed by
Andrii Nakryiko
parent
04e928180c
commit
ce547335d4
@@ -59,9 +59,9 @@ int handler(const void *ctx)
|
||||
/* Kernel pointers */
|
||||
addr_ret = BPF_SNPRINTF(addr_out, sizeof(addr_out), "%pK %px %p",
|
||||
0, 0xFFFF00000ADD4E55, 0xFFFF00000ADD4E55);
|
||||
/* Strings embedding */
|
||||
str_ret = BPF_SNPRINTF(str_out, sizeof(str_out), "%s %+05s",
|
||||
str1, longstr);
|
||||
/* Strings and single-byte character embedding */
|
||||
str_ret = BPF_SNPRINTF(str_out, sizeof(str_out), "%s % 9c %+2c %-3c %04c %0c %+05s",
|
||||
str1, 'a', 'b', 'c', 'd', 'e', longstr);
|
||||
/* Overflow */
|
||||
over_ret = BPF_SNPRINTF(over_out, sizeof(over_out), "%%overflow");
|
||||
/* Padding of fixed width numbers */
|
||||
|
||||
Reference in New Issue
Block a user