Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:strnchr_selftest

Proto:static __init int strnchr_selftest(void)

Type:int

Parameter:Nothing

145  test_string = "abcdefghijkl"
146  empty_string = ""
150  When i < strlen(test_string) + 1 cycle
151  When j < strlen(test_string) + 2 cycle
153  If j <= i Then
154  If Not result Then Continue
156  Return i + 'a' << 8 | j
158  If result - test_string != i Then Return i + 'a' << 8 | j
163  result = strnchr - Find a character in a length limited string*@s: The string to be searched*@count: The number of characters to be searched*@c: The character to search for* Note that the %NUL-terminator is considered part of the string, and can* be searched for.
164  If result Then Return 0x10001
167  result = strnchr - Find a character in a length limited string*@s: The string to be searched*@count: The number of characters to be searched*@c: The character to search for* Note that the %NUL-terminator is considered part of the string, and can* be searched for.
168  If result != empty_string Then Return 0x10002
171  result = strnchr - Find a character in a length limited string*@s: The string to be searched*@count: The number of characters to be searched*@c: The character to search for* Note that the %NUL-terminator is considered part of the string, and can* be searched for.
172  If result Then Return 0x10003
175  result = strnchr - Find a character in a length limited string*@s: The string to be searched*@count: The number of characters to be searched*@c: The character to search for* Note that the %NUL-terminator is considered part of the string, and can* be searched for.
176  If result Then Return 0x10004
179  Return 0
Caller
NameDescribe
string_selftest_init