函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\test_printf.c Create Date:2022-07-27 07:30:00
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:do_test

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

返回类型:int

参数:

类型参数名称
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  如果ret不等于elen
53  打印警告信息("vsnprintf(buf, %d, \"%s\", ...) returned %d, expected %d\n", bufsize, fmt, ret, elen)
55  返回:1
58  如果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
59  打印警告信息("vsnprintf(buf, %d, \"%s\", ...) wrote before buffer\n", bufsize, fmt)
60  返回:1
63  如果非bufsize
65  打印警告信息("vsnprintf(buf, 0, \"%s\", ...) wrote to buffer\n", fmt)
67  返回:1
69  返回:0
72  written等于两数取小(bufsize - 1, elen)
73  如果test_buffer[written]则
74  打印警告信息("vsnprintf(buf, %d, \"%s\", ...) did not nul-terminate buffer\n", bufsize, fmt)
76  返回:1
79  如果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
80  打印警告信息("vsnprintf(buf, %d, \"%s\", ...) wrote beyond the nul-terminator\n", bufsize, fmt)
82  返回:1
85  如果memcmp(test_buffer, expect, written)则
86  打印警告信息("vsnprintf(buf, %d, \"%s\", ...) wrote '%s', expected '%.*s'\n", bufsize, fmt, test_buffer, written, expect)
88  返回:1
90  返回:0
调用者
名称描述
__test