Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\test_printf.c Create Date:2022-07-28 06:32:28
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:do_test

Proto:static int __printf(4, 0) __init do_test(int bufsize, const char *expect, int elen, const char *fmt, va_list ap)

Type:int

Parameter:

TypeParameterName
intbufsize
const char *expect
intelen
const char *fmt
va_listap
45  total_tests++
47  memset(alloced_buffer, FILL_CHAR, BUF_SIZE + 2 * PAD_SIZE)
48  va_copy(aq, ap)
49  ret = vsnprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@args: Arguments for the format string* This function generally
50  va_end(aq)
52  If ret != elen Then
53  pr_warn("vsnprintf(buf, %d, \"%s\", ...) returned %d, expected %d\n", bufsize, fmt, ret, elen)
55  Return 1
58  If memchr_inv - Find an unmatching character in an area of memory.*@start: The memory area*@c: Find a character other than c*@bytes: The size of the area.* returns the address of the first character other than @c, or %NULL Then
59  pr_warn("vsnprintf(buf, %d, \"%s\", ...) wrote before buffer\n", bufsize, fmt)
60  Return 1
63  If Not bufsize Then
65  pr_warn("vsnprintf(buf, 0, \"%s\", ...) wrote to buffer\n", fmt)
67  Return 1
69  Return 0
72  written = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(bufsize - 1, elen)
73  If test_buffer[written] Then
74  pr_warn("vsnprintf(buf, %d, \"%s\", ...) did not nul-terminate buffer\n", bufsize, fmt)
76  Return 1
79  If memchr_inv - Find an unmatching character in an area of memory.*@start: The memory area*@c: Find a character other than c*@bytes: The size of the area.* returns the address of the first character other than @c, or %NULL Then
80  pr_warn("vsnprintf(buf, %d, \"%s\", ...) wrote beyond the nul-terminator\n", bufsize, fmt)
82  Return 1
85  If memcmp(test_buffer, expect, written) Then
86  pr_warn("vsnprintf(buf, %d, \"%s\", ...) wrote '%s', expected '%.*s'\n", bufsize, fmt, test_buffer, written, expect)
88  Return 1
90  Return 0
Caller
NameDescribe
__test