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)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 13 Dec 2021 20:36:21 +0000 (13:36 -0700)
commit37dbb4c7c7442dbfc9b651e4ddd4afe30b26afc9
tree2351f89a8a09e729bae637404531998ebb815d46
parente56e482855b782b0e38b91cc383324bb80461073
kunit: Don't crash if no parameters are generated

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>
lib/kunit/test.c