Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Test that writing the maximum possible value works.

Proto:static void sysctl_test_api_dointvec_write_single_greater_int_max(struct kunit *test)

Type:void

Parameter:

TypeParameterName
struct kunit *test
347  data = 0
348  struct ctl_table table = { Text ID for /proc/sys, or zero = "foo", data = & data, maxlen = sizeof(int), mode = 0644, Callback for text formatting = read a vector of integers, extra1 = & i_zero, extra2 = & i_one_hundred, }
357  max_len = 32 , len = max_len
358  pos = 0
359  buffer = kunit_kzalloc() - Just like kunit_kmalloc(), but zeroes the allocation.*@test: The test context object.*@size: The size in bytes of the desired memory.*@gfp: flags passed to underlying kmalloc().* See kzalloc() and kunit_kmalloc() for more information.
360  __user * user_buffer = buffer
361  greater_than_max = INT_MAX + 1
363  KUNIT_ASSERT_GT() - An assertion that @left is greater than @right(test, greater_than_max, (unsignedlong)INT_MAX)
364  KUNIT_ASSERT_LT() - An assertion that @left is less than @right(test, (size_t)snprintf - 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*@, max_len)
367  KUNIT_EXPECT_EQ() - Sets an expectation that @left and @right are equal(test, - EINVAL, read a vector of integers)
369  KUNIT_ASSERT_EQ() - Sets an assertion that @left and @right are equal(test, max_len, len)
370  KUNIT_EXPECT_EQ() - Sets an expectation that @left and @right are equal(test, 0, * ((int * )data))