From ac9d31e5f853f07cdfd8cd874878fb3c1c097f0c Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 4 Jun 2013 16:32:33 +0200 Subject: doc: Document expect_any(). --- include/cmocka.h | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/cmocka.h b/include/cmocka.h index 67c4ef6..f8fcffe 100644 --- a/include/cmocka.h +++ b/include/cmocka.h @@ -731,15 +731,46 @@ void expect_not_string_count(#function, #parameter, const char *string, size_t c (const void*)(memory), size, count) -/* - * Add an event to allow any value for a parameter checked using - * check_expected(). See will_return() for a description of the count - * parameter. +#if DOXYGEN +/** + * @brief Add an event to check if a parameter (of any value) has been passed. + * + * The event is triggered by calling check_expected() in the mocked function. + * + * @param[in] #function The function to add the check for. + * + * @param[in] #parameter The name of the parameter passed to the function. + * + * @see check_expected(). */ +void expect_any(#function, #parameter); +#else #define expect_any(function, parameter) \ expect_any_count(function, parameter, 1) +#endif + +#if DOXYGEN +/** + * @brief Add an event to repeatedly check if a parameter (of any value) has + * been passed. + * + * The event is triggered by calling check_expected() in the mocked function. + * + * @param[in] #function The function to add the check for. + * + * @param[in] #parameter The name of the parameter passed to the function. + * + * @param[in] count The count parameter returns the number of times the value + * should be returned by check_expected(). If count is set + * to -1 the value will always be returned. + * + * @see check_expected(). + */ +void expect_any_count(#function, #parameter, size_t count); +#else #define expect_any_count(function, parameter, count) \ _expect_any(#function, #parameter, __FILE__, __LINE__, count) +#endif #if DOXYGEN /** -- cgit v1.2.3