Skip to content

Commit

Permalink
Variadic macro extensions to the FFF
Browse files Browse the repository at this point in the history
See header comment in fff.h for details -- summary extracted below:

Return value macros:

SET_RETURN_VAL_SEQ(function_name, ...)
Accepts a raw list of appropriately typed values
SET_RETURN_VAL(function_name, value)
Provided for API consistency

Assertion macros:

TEST_ASSERT_CALLS(function_name, expected_call_count)

TEST_ASSERT_CALLED(function_name)
 Only one call made to the function.

TEST_ASSERT_NOT_CALLED(function_name)
 No calls made to the function.

TEST_ASSERT_CALL(function_name, ...parameters)
 Only one call made to the function with the specified parameter values.

TEST_ASSERT_LAST_CALL(function_name, ...parameters)
 The final call to this function was made with the specified parameter values.

TEST_ASSERT_ANY_CALL(function_name, ...parameters)
 At least one call was made with the specified parameter values.

TEST_ASSERT_NO_CALL(function_name, ...parameters)
 No calls were made with the specified parameter values.

TEST_ASSERT_NTH_CALL(function_name, call_index, ...parameters)
 A specified invocation of the function used the specified parameter values.

<<Amendment 1>>
Added unit tests.
Added TEST_ASSERT_CALL(...), as couldn't get optional parameter verification for
TEST_ASSERT_CALLED to work in c99 mode.
  • Loading branch information
Cormac Cannon committed Apr 10, 2018
1 parent ef24c19 commit 6be4d1e
Show file tree
Hide file tree
Showing 5 changed files with 984 additions and 87 deletions.
Loading

0 comments on commit 6be4d1e

Please sign in to comment.