Commit Graph
4 Commits
Author SHA1 Message Date
David Gow 255ede3b12 lib/cmdline_kunit: Remove a cast which are no-longer required
With some of the stricter type checking in KUnit's EXPECT macros
removed, a cast in cmdline_kunit is no longer required.

Remove the unnecessary cast, using NULL instead of (int *) to make it
clearer.

Signed-off-by: David Gow <[email protected]>
Acked-by: Andy Shevchenko <[email protected]>
Reviewed-by: Brendan Higgins <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>
2021-06-23 16:41:41 -06:00
Andy Shevchenko 0ea0908311 lib/cmdline: Allow get_options() to take 0 to validate the input
Allow get_options() to take 0 as a number of integers parameter to validate
the input.

Signed-off-by: Andy Shevchenko <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
2021-02-15 11:43:31 +01:00
Andy Shevchenko d3c7cfc6d3 lib/cmdline_kunit: add a new test case for get_options()
Add a test case for get_options() which is provided by cmdline.c.

Signed-off-by: Andy Shevchenko <[email protected]>
2021-02-15 11:43:31 +01:00
Andy Shevchenko 7546861a8c lib/cmdline_kunit: add a new test suite for cmdline API
Test get_option() for a starter which is provided by cmdline.c.

[[email protected]: fix warning by constifying cmdline_test_values]
[[email protected]: type of expected returned values should be int]
  Link: https://lkml.kernel.org/r/[email protected]
[[email protected]: provide meaningful MODULE_LICENSE()]
  Link: https://lkml.kernel.org/r/[email protected]

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Andy Shevchenko <[email protected]>
Cc: Shuah Khan <[email protected]>
Cc: Vitor Massaru Iha <[email protected]>
Cc: Mark Brown <[email protected]>
Cc: Brendan Higgins <[email protected]>
Cc: David Gow <[email protected]>
Cc: Matti Vaittinen <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2020-12-15 22:46:16 -08:00