Skip to content

Commit 6f2f793

Browse files
sulixshuahkh
authored andcommitted
kunit: test: Log the correct filter string in executor_test
KUnit's executor_test logs the filter string in KUNIT_ASSERT_EQ_MSG(), but passed a random character from the filter, rather than the whole string. This was found by annotating KUNIT_ASSERT_EQ_MSG() to let gcc validate the format string. Fixes: 76066f9 ("kunit: add tests for filtering attributes") Signed-off-by: David Gow <davidgow@google.com> Tested-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Justin Stitt <justinstitt@google.com> Reviewed-by: Daniel Latypov <dlatypov@google.com> Reviewed-by: Rae Moar <rmoar@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent c5215d5 commit 6f2f793

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/kunit/executor_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static void parse_filter_attr_test(struct kunit *test)
129129
GFP_KERNEL);
130130
for (j = 0; j < filter_count; j++) {
131131
parsed_filters[j] = kunit_next_attr_filter(&filter, &err);
132-
KUNIT_ASSERT_EQ_MSG(test, err, 0, "failed to parse filter '%s'", filters[j]);
132+
KUNIT_ASSERT_EQ_MSG(test, err, 0, "failed to parse filter from '%s'", filters);
133133
}
134134

135135
KUNIT_EXPECT_STREQ(test, kunit_attr_filter_name(parsed_filters[0]), "speed");

0 commit comments

Comments
 (0)