When using CMocka for unit testing, how do I verify parameters passed to a mocked function? Identify the specific CMocka functions used to define expected parameter values in the test setup, and the macro used within the mocked function to assert those values. Explain where each is typically used.
Navigate to the 'Modules' page. Go to the 'Checking Parameters' module to identify functions for setting expected parameter values. Return to the 'Modules' page. Go to the 'Mock Objects' module to identify the macro for asserting received parameters. Synthesize the information from both modules to explain the functions' roles and typical usage in parameter verification.
Identifies `expect_value()` and `expect_string()` (or similar `expect_*` functions like `expect_in_range()`, `expect_not_value()`) as used for setting expected parameters. Identifies `check_expected()` as the macro used within the mocked function for assertion. Explains that `expect_*` functions are called in the test setup (e.g., before the function under test is invoked) to define expectations. Explains that `check_expected()` is called inside the mocked function to perform the actual parameter assertion.