kunit: mock: added bool_return Added mock action for returning bool value from mocked functions. Signed-off-by: Sagi Shahar <sagis@google.com> Change-Id: I43af257f5756dacbacf2c04d74dfcca7fa872b49
diff --git a/include/test/mock.h b/include/test/mock.h index d16ced8..4d8dfa9 100644 --- a/include/test/mock.h +++ b/include/test/mock.h
@@ -1274,6 +1274,7 @@ struct mock_param_matcher *or(struct test *test, struct mock_param_matcher *right_matcher); struct mock_param_matcher *not(struct test *test, struct mock_param_matcher *inner_matcher); +struct mock_action *bool_return(struct test *test, bool ret); struct mock_action *u8_return(struct test *test, u8 ret); struct mock_action *u16_return(struct test *test, u16 ret); struct mock_action *u32_return(struct test *test, u32 ret);
diff --git a/test/common-mocks.c b/test/common-mocks.c index f37ada6..3e15b5c 100644 --- a/test/common-mocks.c +++ b/test/common-mocks.c
@@ -444,6 +444,7 @@ struct mock_param_capturer *mock_ptr_capturer_create( #define DEFINE_RETURN_ACTION(type) \ DEFINE_RETURN_ACTION_WITH_TYPENAME(type, type) +DEFINE_RETURN_ACTION(bool); DEFINE_RETURN_ACTION(u8); DEFINE_RETURN_ACTION(u16); DEFINE_RETURN_ACTION(u32);