@@ -30,7 +30,6 @@ enum kunit_assert_type {
3030
3131/**
3232 * struct kunit_assert - Data for printing a failed assertion or expectation.
33- * @test: the test case this expectation/assertion is associated with.
3433 * @type: the type (either an expectation or an assertion) of this kunit_assert.
3534 * @line: the source code line number that the expectation/assertion is at.
3635 * @file: the file path of the source file that the expectation/assertion is in.
@@ -41,7 +40,6 @@ enum kunit_assert_type {
4140 * format a string to a user reporting the failure.
4241 */
4342struct kunit_assert {
44- struct kunit * test ;
4543 enum kunit_assert_type type ;
4644 int line ;
4745 const char * file ;
@@ -60,14 +58,12 @@ struct kunit_assert {
6058
6159/**
6260 * KUNIT_INIT_ASSERT_STRUCT() - Initializer for a &struct kunit_assert.
63- * @kunit: The test case that this expectation/assertion is associated with.
6461 * @assert_type: The type (assertion or expectation) of this kunit_assert.
6562 * @fmt: The formatting function which builds a string out of this kunit_assert.
6663 *
6764 * The base initializer for a &struct kunit_assert.
6865 */
69- #define KUNIT_INIT_ASSERT_STRUCT (kunit , assert_type , fmt ) { \
70- .test = kunit, \
66+ #define KUNIT_INIT_ASSERT_STRUCT (assert_type , fmt ) { \
7167 .type = assert_type, \
7268 .file = __FILE__, \
7369 .line = __LINE__, \
@@ -96,15 +92,13 @@ void kunit_fail_assert_format(const struct kunit_assert *assert,
9692
9793/**
9894 * KUNIT_INIT_FAIL_ASSERT_STRUCT() - Initializer for &struct kunit_fail_assert.
99- * @test: The test case that this expectation/assertion is associated with.
10095 * @type: The type (assertion or expectation) of this kunit_assert.
10196 *
10297 * Initializes a &struct kunit_fail_assert. Intended to be used in
10398 * KUNIT_EXPECT_* and KUNIT_ASSERT_* macros.
10499 */
105- #define KUNIT_INIT_FAIL_ASSERT_STRUCT (test , type ) { \
106- .assert = KUNIT_INIT_ASSERT_STRUCT(test, \
107- type, \
100+ #define KUNIT_INIT_FAIL_ASSERT_STRUCT (type ) { \
101+ .assert = KUNIT_INIT_ASSERT_STRUCT(type, \
108102 kunit_fail_assert_format) \
109103}
110104
@@ -129,17 +123,15 @@ void kunit_unary_assert_format(const struct kunit_assert *assert,
129123
130124/**
131125 * KUNIT_INIT_UNARY_ASSERT_STRUCT() - Initializes &struct kunit_unary_assert.
132- * @test: The test case that this expectation/assertion is associated with.
133126 * @type: The type (assertion or expectation) of this kunit_assert.
134127 * @cond: A string representation of the expression asserted true or false.
135128 * @expect_true: True if of type KUNIT_{EXPECT|ASSERT}_TRUE, false otherwise.
136129 *
137130 * Initializes a &struct kunit_unary_assert. Intended to be used in
138131 * KUNIT_EXPECT_* and KUNIT_ASSERT_* macros.
139132 */
140- #define KUNIT_INIT_UNARY_ASSERT_STRUCT (test , type , cond , expect_true ) { \
141- .assert = KUNIT_INIT_ASSERT_STRUCT(test, \
142- type, \
133+ #define KUNIT_INIT_UNARY_ASSERT_STRUCT (type , cond , expect_true ) { \
134+ .assert = KUNIT_INIT_ASSERT_STRUCT(type, \
143135 kunit_unary_assert_format), \
144136 .condition = cond, \
145137 .expected_true = expect_true \
@@ -167,17 +159,15 @@ void kunit_ptr_not_err_assert_format(const struct kunit_assert *assert,
167159/**
168160 * KUNIT_INIT_PTR_NOT_ERR_ASSERT_STRUCT() - Initializes a
169161 * &struct kunit_ptr_not_err_assert.
170- * @test: The test case that this expectation/assertion is associated with.
171162 * @type: The type (assertion or expectation) of this kunit_assert.
172163 * @txt: A string representation of the expression passed to the expectation.
173164 * @val: The actual evaluated pointer value of the expression.
174165 *
175166 * Initializes a &struct kunit_ptr_not_err_assert. Intended to be used in
176167 * KUNIT_EXPECT_* and KUNIT_ASSERT_* macros.
177168 */
178- #define KUNIT_INIT_PTR_NOT_ERR_STRUCT (test , type , txt , val ) { \
179- .assert = KUNIT_INIT_ASSERT_STRUCT(test, \
180- type, \
169+ #define KUNIT_INIT_PTR_NOT_ERR_STRUCT (type , txt , val ) { \
170+ .assert = KUNIT_INIT_ASSERT_STRUCT(type, \
181171 kunit_ptr_not_err_assert_format), \
182172 .text = txt, \
183173 .value = val \
@@ -212,7 +202,6 @@ void kunit_binary_assert_format(const struct kunit_assert *assert,
212202/**
213203 * KUNIT_INIT_BINARY_ASSERT_STRUCT() - Initializes a
214204 * &struct kunit_binary_assert.
215- * @test: The test case that this expectation/assertion is associated with.
216205 * @type: The type (assertion or expectation) of this kunit_assert.
217206 * @op_str: A string representation of the comparison operator (e.g. "==").
218207 * @left_str: A string representation of the expression in the left slot.
@@ -223,15 +212,13 @@ void kunit_binary_assert_format(const struct kunit_assert *assert,
223212 * Initializes a &struct kunit_binary_assert. Intended to be used in
224213 * KUNIT_EXPECT_* and KUNIT_ASSERT_* macros.
225214 */
226- #define KUNIT_INIT_BINARY_ASSERT_STRUCT (test , \
227- type , \
215+ #define KUNIT_INIT_BINARY_ASSERT_STRUCT (type , \
228216 op_str , \
229217 left_str , \
230218 left_val , \
231219 right_str , \
232220 right_val ) { \
233- .assert = KUNIT_INIT_ASSERT_STRUCT(test, \
234- type, \
221+ .assert = KUNIT_INIT_ASSERT_STRUCT(type, \
235222 kunit_binary_assert_format), \
236223 .operation = op_str, \
237224 .left_text = left_str, \
@@ -269,7 +256,6 @@ void kunit_binary_ptr_assert_format(const struct kunit_assert *assert,
269256/**
270257 * KUNIT_INIT_BINARY_PTR_ASSERT_STRUCT() - Initializes a
271258 * &struct kunit_binary_ptr_assert.
272- * @test: The test case that this expectation/assertion is associated with.
273259 * @type: The type (assertion or expectation) of this kunit_assert.
274260 * @op_str: A string representation of the comparison operator (e.g. "==").
275261 * @left_str: A string representation of the expression in the left slot.
@@ -280,15 +266,13 @@ void kunit_binary_ptr_assert_format(const struct kunit_assert *assert,
280266 * Initializes a &struct kunit_binary_ptr_assert. Intended to be used in
281267 * KUNIT_EXPECT_* and KUNIT_ASSERT_* macros.
282268 */
283- #define KUNIT_INIT_BINARY_PTR_ASSERT_STRUCT (test , \
284- type , \
269+ #define KUNIT_INIT_BINARY_PTR_ASSERT_STRUCT (type , \
285270 op_str , \
286271 left_str , \
287272 left_val , \
288273 right_str , \
289274 right_val ) { \
290- .assert = KUNIT_INIT_ASSERT_STRUCT(test, \
291- type, \
275+ .assert = KUNIT_INIT_ASSERT_STRUCT(type, \
292276 kunit_binary_ptr_assert_format), \
293277 .operation = op_str, \
294278 .left_text = left_str, \
@@ -326,7 +310,6 @@ void kunit_binary_str_assert_format(const struct kunit_assert *assert,
326310/**
327311 * KUNIT_INIT_BINARY_STR_ASSERT_STRUCT() - Initializes a
328312 * &struct kunit_binary_str_assert.
329- * @test: The test case that this expectation/assertion is associated with.
330313 * @type: The type (assertion or expectation) of this kunit_assert.
331314 * @op_str: A string representation of the comparison operator (e.g. "==").
332315 * @left_str: A string representation of the expression in the left slot.
@@ -337,15 +320,13 @@ void kunit_binary_str_assert_format(const struct kunit_assert *assert,
337320 * Initializes a &struct kunit_binary_str_assert. Intended to be used in
338321 * KUNIT_EXPECT_* and KUNIT_ASSERT_* macros.
339322 */
340- #define KUNIT_INIT_BINARY_STR_ASSERT_STRUCT (test , \
341- type , \
323+ #define KUNIT_INIT_BINARY_STR_ASSERT_STRUCT (type , \
342324 op_str , \
343325 left_str , \
344326 left_val , \
345327 right_str , \
346328 right_val ) { \
347- .assert = KUNIT_INIT_ASSERT_STRUCT(test, \
348- type, \
329+ .assert = KUNIT_INIT_ASSERT_STRUCT(type, \
349330 kunit_binary_str_assert_format), \
350331 .operation = op_str, \
351332 .left_text = left_str, \
0 commit comments