]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
kunit: Don't crash if no parameters are generated
authorDavid Gow <davidgow@google.com>
Tue, 2 Nov 2021 07:30:13 +0000 (00:30 -0700)
committerPaolo Pisati <paolo.pisati@canonical.com>
Fri, 28 Jan 2022 10:02:34 +0000 (11:02 +0100)
commited919ba3f2e9867c90cf94f1a3684743267328e7
treedf0139085eef38528eca4bfaf2324dfd1b8dba22
parent313e2377484b6ad9a57b0c1377e8a6bf6de447c0
kunit: Don't crash if no parameters are generated

BugLink: https://bugs.launchpad.net/bugs/1959376
[ Upstream commit 37dbb4c7c7442dbfc9b651e4ddd4afe30b26afc9 ]

It's possible that a parameterised test could end up with zero
parameters. At the moment, the test function will nevertheless be called
with NULL as the parameter. Instead, don't try to run the test code, and
just mark the test as SKIPped.

Reported-by: Daniel Latypov <dlatypov@google.com>
Signed-off-by: David Gow <davidgow@google.com>
Reviewed-by: Daniel Latypov <dlatypov@google.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
lib/kunit/test.c