summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Gow <davidgow@google.com>2024-02-21 17:27:14 +0800
committerSasha Levin <sashal@kernel.org>2024-03-26 18:19:18 -0400
commit8c018386023b949a23a77ba2cd5c43ee626f4609 (patch)
treeb0bb5c292984a50842d40676538cfa061a92a5db /lib
parentc6f95031cf21701db5d2b449bf77b73e98edabde (diff)
downloadlinux-rpi-8c018386023b949a23a77ba2cd5c43ee626f4609.tar.gz
linux-rpi-8c018386023b949a23a77ba2cd5c43ee626f4609.tar.bz2
linux-rpi-8c018386023b949a23a77ba2cd5c43ee626f4609.zip
kunit: test: Log the correct filter string in executor_test
[ Upstream commit 6f2f793fba78eb4a0d5a34a71bc781118ed923d3 ] 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: 76066f93f1df ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/kunit/executor_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/kunit/executor_test.c b/lib/kunit/executor_test.c
index 22d4ee86dbed..3f7f967e3688 100644
--- a/lib/kunit/executor_test.c
+++ b/lib/kunit/executor_test.c
@@ -129,7 +129,7 @@ static void parse_filter_attr_test(struct kunit *test)
GFP_KERNEL);
for (j = 0; j < filter_count; j++) {
parsed_filters[j] = kunit_next_attr_filter(&filter, &err);
- KUNIT_ASSERT_EQ_MSG(test, err, 0, "failed to parse filter '%s'", filters[j]);
+ KUNIT_ASSERT_EQ_MSG(test, err, 0, "failed to parse filter from '%s'", filters);
}
KUNIT_EXPECT_STREQ(test, kunit_attr_filter_name(parsed_filters[0]), "speed");