|
cmocka 2.0.0
Unit testing library with mock support
|
Validate function parameters match expected values. More...
Data Structures | |
| struct | SourceLocation |
| struct | CheckParameterEvent |
| struct | CheckParameterEventData |
Typedefs | |
| typedef int(* | CheckParameterValue) (const uintmax_t value, const uintmax_t check_value_data) |
| typedef int(* | CheckParameterValueData) (const CMockaValueData value, const CMockaValueData check_value_data) |
| typedef int(* | CheckIntParameterValue) (const intmax_t value, const intmax_t check_value_data) |
| typedef int(* | CheckUintParameterValue) (const uintmax_t value, const uintmax_t check_value_data) |
| typedef struct SourceLocation | SourceLocation |
| typedef struct CheckParameterEvent | CheckParameterEvent |
| typedef struct CheckParameterEventData | CheckParameterEventData |
Functions | |
| void | expect_check (function, parameter, CheckParameterValue check_function, const void *check_data) |
| void | expect_check_count (function, parameter, CheckParameterValue check_function, const void *check_data, size_t count) |
| void | expect_check_data (function, parameter, CheckParameterValueData check_function, CMockaValueData check_data) |
| Add a custom parameter checking function using CMockaValueData (new API). | |
| void | expect_check_data_count (function, parameter, CheckParameterValueData check_function, CMockaValueData check_data, size_t count) |
| Add a custom parameter checking function using CMockaValueData with count (new API). | |
| void | expect_in_set (#function, #parameter, uintmax_t value_array[]) |
| void | expect_in_set (#function, #parameter, intmax_t value_array[]) |
| Add an event to check if the parameter value is part of the provided integer array. | |
| void | expect_in_set_count (#function, #parameter, uintmax_t value_array[], size_t count) |
| void | expect_int_in_set_count (#function, #parameter, intmax_t value_array[], size_t count) |
| Add an event to check if the parameter value is part of the provided integer array. | |
| void | expect_uint_in_set_count (#function, #parameter, uintmax_t value_array[], size_t count) |
| Add an event to check if the parameter value is part of the provided unsigned integer array. | |
| void | expect_not_in_set (#function, #parameter, uintmax_t value_array[]) |
| void | expect_not_in_set_count (#function, #parameter, uintmax_t value_array[], size_t count) |
| void | expect_int_not_in_set (#function, #parameter, intmax_t value_array[]) |
| Add an event to check if the integer parameter value is not part of the provided integer array. | |
| void | expect_int_not_in_set_count (#function, intmax_t value_array[], size_t count) |
| Add an event to check if the integer parameter value is not part of the provided integer array. | |
| void | expect_uint_not_in_set (#function, #parameter, uintmax_t value_array[]) |
| Add an event to check if the unsigned integer parameter value is not part of the provided unsigned integer array. | |
| void | expect_uint_not_in_set_count (#function, uintmax_t value_array[], size_t count) |
| Add an event to check if the unsigned integer parameter value is not part of the provided unsigned integer array. | |
| void | expect_float_in_set (#function, #parameter, double value_array[], double epsilon) |
| Add an event to check if the float parameter value is part of the provided array. | |
| void | expect_float_in_set_count (#function, #parameter, double value_array[], double epsilon, size_t count) |
| Add an event to check if the float parameter value is part of the provided integer array. | |
| void | expect_float_not_in_set (#function, #parameter, double value_array[], double epsilon) |
| Add an event to check if the float parameter value is not part of the provided array. | |
| void | expect_float_not_in_set_count (#function, #parameter, double value_array[], double epsilon, size_t count) |
| Add an event to check if the float parameter value is not part of the provided integer array. | |
| void | expect_in_range (#function, #parameter, uintmax_t minimum, uintmax_t maximum) |
| void | expect_in_range_count (#function, #parameter, uintmax_t minimum, uintmax_t maximum, size_t count) |
| void | expect_int_in_range (#function, intmax_t minimum, intmax_t maximum) |
| Add an event to check an integer parameter is inside a numerical range. The check would succeed if minimum <= value <= maximum. | |
| void | expect_int_in_range_count (#function, intmax_t minimum, intmax_t maximum, size_t count) |
| Add an event to repeatedly check an integer parameter is inside a numerical range. The check would succeed if minimum <= value <= maximum. | |
| void | expect_uint_in_range (#function, uintmax_t minimum, uintmax_t maximum) |
| Add an event to check an unsigned integer parameter is inside a numerical range. The check would succeed if minimum <= value <= maximum. | |
| void | expect_uint_in_range_count (#function, uintmax_t minimum, uintmax_t maximum, size_t count) |
| Add an event to repeatedly check an unsigned integer parameter is inside a numerical range. The check would succeed if minimum <= value <= maximum. | |
| void | expect_not_in_range (#function, #parameter, uintmax_t minimum, uintmax_t maximum) |
| Add an event to check a parameter is outside a numerical range. The check would succeed if minimum > value > maximum. | |
| void | expect_not_in_range_count (#function, #parameter, uintmax_t minimum, uintmax_t maximum, size_t count) |
| Add an event to repeatedly check a parameter is outside a numerical range. The check would succeed if minimum > value > maximum. | |
| void | expect_int_not_in_range (#function, intmax_t minimum, intmax_t maximum) |
| Add an event to check an integer parameter is outside a numerical range. The check would succeed if minimum > value > maximum. | |
| void | expect_int_not_in_range_count (#function, intmax_t minimum, intmax_t maximum, size_t count) |
| Add an event to repeatedly check an integer parameter is outside a numerical range. The check would succeed if minimum > value > maximum. | |
| void | expect_uint_not_in_range (#function, uintmax_t minimum, uintmax_t maximum) |
| Add an event to check an unsigned integer parameter is outside a numerical range. The check would succeed if minimum > value > maximum. | |
| void | expect_uint_not_in_range_count (#function, uintmax_t minimum, uintmax_t maximum, size_t count) |
| Add an event to repeatedly check an unsigned integer parameter is outside a numerical range. The check would succeed if minimum > value > maximum. | |
| void | expect_float_in_range (#function, #parameter, double minimum, double maximum, double epsilon) |
| Add an event to check a parameter is inside a numerical range. The check would succeed if minimum <= value <= maximum. | |
| void | expect_float_in_range_count (#function, #parameter, double minimum, double maximum, double epsilon, size_t count) |
| Add an event to repeatedly check a parameter is inside a numerical range. The check would succeed if minimum <= value <= maximum. | |
| void | expect_float_not_in_range (#function, #parameter, double minimum, double maximum, double epsilon) |
| Add an event to check a parameter is outside a numerical range. The check would succeed if minimum > value > maximum. | |
| void | expect_float_not_in_range_count (#function, #parameter, double minimum, double maximum, double epsilon, size_t count) |
| Add an event to repeatedly check a parameter is outside a numerical range. The check would succeed if minimum > value > maximum. | |
| void | expect_value (#function, #parameter, uintmax_t value) |
| void | expect_value_count (#function, #parameter, uintmax_t value, size_t count) |
| void | expect_int_value (#function, #parameter, intmax_t value) |
| Add an event to check if an integer parameter is the given value. | |
| void | expect_int_value_count (#function, intmax_t value, size_t count) |
| Add an event to repeatedly check if an integer parameter is the given value. | |
| void | expect_uint_value (#function, #parameter, uintmax_t value) |
| Add an event to check if an unsigned integer parameter is the given value. | |
| void | expect_uint_value_count (#function, uintmax_t value, size_t count) |
| Add an event to repeatedly check if an unsigned integer parameter is the given value. | |
| void | expect_int_not_value (#function, #parameter, intmax_t value) |
| Add an event to check if a parameter (int) isn't the given value. | |
| void | expect_int_not_value_count (#function, intmax_t value, size_t count) |
| Add an event to repeatedly check if a parameter (int) isn't the given value. | |
| void | expect_uint_not_value (#function, #parameter, uintmax_t value) |
| Add an event to check if a parameter (uint) isn't the given value. | |
| void | expect_uint_not_value_count (#function, uintmax_t value, size_t count) |
| Add an event to repeatedly check if a parameter (uint) isn't the given value. | |
| void | expect_not_value (#function, #parameter, uintmax_t value) |
| void | expect_not_value_count (#function, #parameter, uintmax_t value, size_t count) |
| void | expect_float (#function, #parameter, double value, double epsilon) |
| Add an event to check if a parameter is the given floating point value. | |
| void | expect_float_count (#function, #parameter, double value, double epsilon, size_t count) |
| Add an event to repeatedly check if a parameter is the given floating point value. | |
| void | expect_not_float (#function, #parameter, double value, double epsilon) |
| Add an event to check if a parameter isn't the given floating point value. | |
| void | expect_not_float_count (#function, #parameter, double value, double epsilon, size_t count) |
| Add an event to repeatedly check if a parameter isn't the floating point value. | |
| void | expect_double (#function, #parameter, double value, double epsilon) |
| Add an event to check if a parameter is the given double precision floating point value. | |
| void | expect_double_count (#function, double value, double epsilon, size_t count) |
| Add an event to repeatedly check if a parameter is the given double precision floating point value. | |
| void | expect_not_double (#function, #parameter, double value, double epsilon) |
| Add an event to check if a parameter isn't the given double precision floating point value. | |
| void | expect_not_double_count (#function, double value, double epsilon, size_t count) |
| Add an event to repeatedly check if a parameter isn't the double precision floating point value. | |
| void | expect_string (#function, #parameter, const char *string) |
| Add an event to check if the parameter value is equal to the provided string. | |
| void | expect_string_count (#function, #parameter, const char *string, size_t count) |
| Add an event to check if the parameter value is equal to the provided string. | |
| void | expect_not_string (#function, #parameter, const char *string) |
| Add an event to check if the parameter value isn't equal to the provided string. | |
| void | expect_not_string_count (#function, #parameter, const char *string, size_t count) |
| Add an event to check if the parameter value isn't equal to the provided string. | |
| void | expect_memory (#function, #parameter, void *memory, size_t size) |
| Add an event to check if the parameter does match an area of memory. | |
| void | expect_memory_count (#function, #parameter, void *memory, size_t size, size_t count) |
| Add an event to repeatedly check if the parameter does match an area of memory. | |
| void | expect_not_memory (#function, #parameter, void *memory, size_t size) |
| Add an event to check if the parameter doesn't match an area of memory. | |
| void | expect_not_memory_count (#function, #parameter, void *memory, size_t size, size_t count) |
| Add an event to repeatedly check if the parameter doesn't match an area of memory. | |
| void | expect_any (#function, #parameter) |
| Add an event to check if a parameter (of any value) has been passed. | |
| void | expect_any_always (#function, #parameter) |
| Add an event to always check if a parameter (of any value) has been passed. | |
| void | expect_any_count (#function, #parameter, size_t count) |
| Add an event to repeatedly check if a parameter (of any value) has been passed. | |
| void | check_expected (#parameter) |
| void | check_expected_any (#parameter) |
| Check that any parameter value matches the next value in the queue. | |
| void | check_expected_ptr (#parameter) |
| Determine whether a function parameter is correct. | |
| void | check_expected_int (#parameter) |
| Determine whether a function parameter is correct. | |
| void | check_expected_uint (#parameter) |
| Determine whether a function parameter is correct. | |
| void | check_expected_float (#parameter) |
| Determine whether a function parameter is correct. | |
| void | check_expected_double (#parameter) |
| Determine whether a function parameter is correct. | |
Validate function parameters match expected values.
Functionality to store expected values for mock function parameters.
In addition to storing the return values of mock functions, cmocka provides functionality to store expected values for mock function parameters using the expect_*() functions provided. A mock function parameter can then be validated using the check_expected_*() macros.
Successive calls to expect_*() macros for a parameter queues values to check the specified parameter. check_expected_*() checks a function parameter against the next value queued using expect_*(), if the parameter check fails a test failure is signalled. In addition if check_expected_*() is called and no more parameter values are queued a test failure occurs.
The following test stub illustrates how to do this. First is the the function we call in the test driver:
Now the chef_cook function can check if the parameter we got passed is the parameter which is expected by the test driver. This can be done the following way:
For a complete example please take a look here
| typedef int(* CheckIntParameterValue) (const intmax_t value, const intmax_t check_value_data) |
Function that determines whether a function parameter value is correct.
| typedef struct CheckParameterEvent CheckParameterEvent |
Event that's called to check a parameter value (old API).
| typedef struct CheckParameterEventData CheckParameterEventData |
Event that's called to check a parameter value (new API with CMockaValueData).
| typedef int(* CheckParameterValue) (const uintmax_t value, const uintmax_t check_value_data) |
Function that determines whether a function parameter value is correct (old API).
| typedef int(* CheckParameterValueData) (const CMockaValueData value, const CMockaValueData check_value_data) |
Function that determines whether a function parameter value is correct (new API with CMockaValueData).
| typedef int(* CheckUintParameterValue) (const uintmax_t value, const uintmax_t check_value_data) |
Function that determines whether a function parameter value is correct.
| typedef struct SourceLocation SourceLocation |
Location within some source code.
| void check_expected | ( | # | parameter | ) |
| void check_expected_any | ( | # | parameter | ) |
Check that any parameter value matches the next value in the queue.
This generic parameter checker works with any type including structs passed by value. It passes the address of the parameter, making it suitable for struct validation with custom checkers.
Use this when:
For scalar types, prefer the type-specific versions:
| [in] | parameter | The parameter to check. |
| void check_expected_double | ( | # | parameter | ) |
Determine whether a function parameter is correct.
This ensures the next value queued by one of the expect*_double() macros matches the specified variable.
This function needs to be called in the mock object.
| [in] | parameter | The parameter to check. |
| void check_expected_float | ( | # | parameter | ) |
Determine whether a function parameter is correct.
This ensures the next value queued by one of the expect*_float() macros matches the specified variable.
This function needs to be called in the mock object.
| [in] | parameter | The parameter to check. |
| void check_expected_int | ( | # | parameter | ) |
Determine whether a function parameter is correct.
This ensures the next value queued by one of the expect_int*() macros matches the specified variable.
This function needs to be called in the mock object.
| [in] | parameter | The parameter to check. |
| void check_expected_ptr | ( | # | parameter | ) |
Determine whether a function parameter is correct.
This ensures the next value queued by one of the expect_*() macros matches the specified variable.
This function needs to be called in the mock object.
| [in] | parameter | The pointer to check. |
| void check_expected_uint | ( | # | parameter | ) |
Determine whether a function parameter is correct.
This ensures the next value queued by one of the expect_uint*() macros matches the specified variable.
This function needs to be called in the mock object.
| [in] | parameter | The parameter to check. |
| void expect_any | ( | # | function, |
| # | parameter ) |
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.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. |
| void expect_any_always | ( | # | function, |
| # | parameter ) |
Add an event to always check if a parameter (of any value) has been passed.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. |
| void expect_any_count | ( | # | function, |
| # | parameter, | ||
| size_t | count ) |
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.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [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. |
| void expect_check | ( | function | , |
| parameter | , | ||
| CheckParameterValue | check_function, | ||
| const void * | check_data ) |
| void expect_check_count | ( | function | , |
| parameter | , | ||
| CheckParameterValue | check_function, | ||
| const void * | check_data, | ||
| size_t | count ) |
| void expect_check_data | ( | function | , |
| parameter | , | ||
| CheckParameterValueData | check_function, | ||
| CMockaValueData | check_data ) |
Add a custom parameter checking function using CMockaValueData (new API).
This is the new API that uses CMockaValueData for type-safe parameter checking. It allows checking of integer, float, double, and pointer values.
| [in] | function | The function to add a custom parameter checking function for. | |
| [in] | parameter | The parameters passed to the function. | |
| [in] | check_function | The check function to call (CheckParameterValueData). | |
| [in] | check_data | The data to pass to the check function (CMockaValueData). |
The checker function must have the following signature:
The checker function should return:
When the checker returns zero, cmocka will fail the test with an appropriate error message.
The CMockaValueData union contains the following fields:
| void expect_check_data_count | ( | function | , |
| parameter | , | ||
| CheckParameterValueData | check_function, | ||
| CMockaValueData | check_data, | ||
| size_t | count ) |
Add a custom parameter checking function using CMockaValueData with count (new API).
This is the new API that uses CMockaValueData for type-safe parameter checking. This version allows you to specify how many times the check should be performed.
| [in] | function | The function to add a custom parameter checking function for. | |
| [in] | parameter | The parameters passed to the function. | |
| [in] | check_function | The check function to call (CheckParameterValueData). | |
| [in] | check_data | The data to pass to the check function (CMockaValueData). | |
| [in] | count | The number of times this check should be called.
|
See expect_check_data() for detailed documentation on the checker function interface, usage notes, and examples.
| void expect_double | ( | # | function, |
| # | parameter, | ||
| double | value, | ||
| double | epsilon ) |
Add an event to check if a parameter is the given double precision floating point value.
The event is triggered by calling check_expected_double() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value | The value to check. | |
| [in] | epsilon | The epsilon used as margin for double comparison. |
| void expect_double_count | ( | # | function, |
| double | value, | ||
| double | epsilon, | ||
| size_t | count ) |
Add an event to repeatedly check if a parameter is the given double precision floating point value.
The event is triggered by calling check_expected_double() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value | The value to check. | |
| [in] | epsilon | The epsilon used as margin for double comparison. | |
| [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. |
| void expect_float | ( | # | function, |
| # | parameter, | ||
| double | value, | ||
| double | epsilon ) |
Add an event to check if a parameter is the given floating point value.
The event is triggered by calling check_expected_float() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value | The value to check. | |
| [in] | epsilon | The epsilon used as margin for float comparison. |
| void expect_float_count | ( | # | function, |
| # | parameter, | ||
| double | value, | ||
| double | epsilon, | ||
| size_t | count ) |
Add an event to repeatedly check if a parameter is the given floating point value.
The event is triggered by calling check_expected_float() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value | The value to check. | |
| [in] | epsilon | The epsilon used as margin for float comparison. | |
| [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. |
| void expect_float_in_range | ( | # | function, |
| # | parameter, | ||
| double | minimum, | ||
| double | maximum, | ||
| double | epsilon ) |
Add an event to check a parameter is inside a numerical range. The check would succeed if minimum <= value <= maximum.
The event is triggered by calling check_expected_float() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | minimum | The lower boundary of the interval to check against. | |
| [in] | maximum | The upper boundary of the interval to check against. | |
| [in] | epsilon | The epsilon used as margin for float comparison. |
| void expect_float_in_range_count | ( | # | function, |
| # | parameter, | ||
| double | minimum, | ||
| double | maximum, | ||
| double | epsilon, | ||
| size_t | count ) |
Add an event to repeatedly check a parameter is inside a numerical range. The check would succeed if minimum <= value <= maximum.
The event is triggered by calling check_expected_float() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | minimum | The lower boundary of the interval to check against. | |
| [in] | maximum | The upper boundary of the interval to check against. | |
| [in] | epsilon | The epsilon used as margin for float comparison. | |
| [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. |
| void expect_float_in_set | ( | # | function, |
| # | parameter, | ||
| double | value_array[], | ||
| double | epsilon ) |
Add an event to check if the float parameter value is part of the provided array.
The event is triggered by calling check_expected_float() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | epsilon | The epsilon used as margin for float comparison. | |
| [in] | value_array[] | The array to check for the value. |
| void expect_float_in_set_count | ( | # | function, |
| # | parameter, | ||
| double | value_array[], | ||
| double | epsilon, | ||
| size_t | count ) |
Add an event to check if the float parameter value is part of the provided integer array.
The event is triggered by calling check_expected_float() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value_array[] | The array to check for the value. | |
| [in] | epsilon | The epsilon used as margin for float comparison. | |
| [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. |
| void expect_float_not_in_range | ( | # | function, |
| # | parameter, | ||
| double | minimum, | ||
| double | maximum, | ||
| double | epsilon ) |
Add an event to check a parameter is outside a numerical range. The check would succeed if minimum > value > maximum.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | minimum | The lower boundary of the interval to check against. | |
| [in] | maximum | The upper boundary of the interval to check against. | |
| [in] | epsilon | The epsilon used as margin for float comparison. |
| void expect_float_not_in_range_count | ( | # | function, |
| # | parameter, | ||
| double | minimum, | ||
| double | maximum, | ||
| double | epsilon, | ||
| size_t | count ) |
Add an event to repeatedly check a parameter is outside a numerical range. The check would succeed if minimum > value > maximum.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | minimum | The lower boundary of the interval to check against. | |
| [in] | maximum | The upper boundary of the interval to check against. | |
| [in] | epsilon | The epsilon used as margin for float comparison. | |
| [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. |
| void expect_float_not_in_set | ( | # | function, |
| # | parameter, | ||
| double | value_array[], | ||
| double | epsilon ) |
Add an event to check if the float parameter value is not part of the provided array.
The event is triggered by calling check_expected_float() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | epsilon | The epsilon used as margin for float comparison. | |
| [in] | value_array[] | The array to check for the value. |
| void expect_float_not_in_set_count | ( | # | function, |
| # | parameter, | ||
| double | value_array[], | ||
| double | epsilon, | ||
| size_t | count ) |
Add an event to check if the float parameter value is not part of the provided integer array.
The event is triggered by calling check_expected_float() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value_array[] | The array to check for the value. | |
| [in] | epsilon | The epsilon used as margin for float comparison. | |
| [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. |
| void expect_in_range | ( | # | function, |
| # | parameter, | ||
| uintmax_t | minimum, | ||
| uintmax_t | maximum ) |
| void expect_in_range_count | ( | # | function, |
| # | parameter, | ||
| uintmax_t | minimum, | ||
| uintmax_t | maximum, | ||
| size_t | count ) |
| void expect_in_set | ( | # | function, |
| # | parameter, | ||
| intmax_t | value_array[] ) |
Add an event to check if the parameter value is part of the provided integer array.
Add an event to check if the parameter value is part of the provided unsigned integer array.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value_array[] | The array to check for the value. |
| void expect_in_set | ( | # | function, |
| # | parameter, | ||
| uintmax_t | value_array[] ) |
| void expect_in_set_count | ( | # | function, |
| # | parameter, | ||
| uintmax_t | value_array[], | ||
| size_t | count ) |
| void expect_int_in_range | ( | # | function, |
| intmax_t | minimum, | ||
| intmax_t | maximum ) |
Add an event to check an integer parameter is inside a numerical range. The check would succeed if minimum <= value <= maximum.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | minimum | The lower boundary of the interval to check against. | |
| [in] | maximum | The upper boundary of the interval to check against. |
| void expect_int_in_range_count | ( | # | function, |
| intmax_t | minimum, | ||
| intmax_t | maximum, | ||
| size_t | count ) |
Add an event to repeatedly check an integer parameter is inside a numerical range. The check would succeed if minimum <= value <= maximum.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | minimum | The lower boundary of the interval to check against. | |
| [in] | maximum | The upper boundary of the interval to check against. | |
| [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. |
| void expect_int_in_set_count | ( | # | function, |
| # | parameter, | ||
| intmax_t | value_array[], | ||
| size_t | count ) |
Add an event to check if the parameter value is part of the provided integer array.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value_array[] | The array to check for the value. | |
| [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. |
| void expect_int_not_in_range | ( | # | function, |
| intmax_t | minimum, | ||
| intmax_t | maximum ) |
Add an event to check an integer parameter is outside a numerical range. The check would succeed if minimum > value > maximum.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | minimum | The lower boundary of the interval to check against. | |
| [in] | maximum | The upper boundary of the interval to check against. |
| void expect_int_not_in_range_count | ( | # | function, |
| intmax_t | minimum, | ||
| intmax_t | maximum, | ||
| size_t | count ) |
Add an event to repeatedly check an integer parameter is outside a numerical range. The check would succeed if minimum > value > maximum.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | minimum | The lower boundary of the interval to check against. | |
| [in] | maximum | The upper boundary of the interval to check against. | |
| [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. |
| void expect_int_not_in_set | ( | # | function, |
| # | parameter, | ||
| intmax_t | value_array[] ) |
Add an event to check if the integer parameter value is not part of the provided integer array.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value_array[] | The array to check for the value. |
| void expect_int_not_in_set_count | ( | # | function, |
| intmax_t | value_array[], | ||
| size_t | count ) |
Add an event to check if the integer parameter value is not part of the provided integer array.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value_array[] | The array to check for the value. | |
| [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. |
| void expect_int_not_value | ( | # | function, |
| # | parameter, | ||
| intmax_t | value ) |
Add an event to check if a parameter (int) isn't the given value.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value | The value (intmax_t) to check. |
| void expect_int_not_value_count | ( | # | function, |
| intmax_t | value, | ||
| size_t | count ) |
Add an event to repeatedly check if a parameter (int) isn't the given value.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value | The value (intmax_t) to check. | |
| [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. |
| void expect_int_value | ( | # | function, |
| # | parameter, | ||
| intmax_t | value ) |
Add an event to check if an integer parameter is the given value.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value | The value to check. |
| void expect_int_value_count | ( | # | function, |
| intmax_t | value, | ||
| size_t | count ) |
Add an event to repeatedly check if an integer parameter is the given value.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value | The value to check. | |
| [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. |
| void expect_memory | ( | # | function, |
| # | parameter, | ||
| void * | memory, | ||
| size_t | size ) |
Add an event to check if the parameter does match an area of memory.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | memory | The memory to compare. | |
| [in] | size | The size of the memory to compare. |
| void expect_memory_count | ( | # | function, |
| # | parameter, | ||
| void * | memory, | ||
| size_t | size, | ||
| size_t | count ) |
Add an event to repeatedly check if the parameter does match an area of memory.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | memory | The memory to compare. | |
| [in] | size | The size of the memory to compare. | |
| [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. |
| void expect_not_double | ( | # | function, |
| # | parameter, | ||
| double | value, | ||
| double | epsilon ) |
Add an event to check if a parameter isn't the given double precision floating point value.
The event is triggered by calling check_expected_double() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value | The value to check. | |
| [in] | epsilon | The epsilon used as margin for double comparison. |
| void expect_not_double_count | ( | # | function, |
| double | value, | ||
| double | epsilon, | ||
| size_t | count ) |
Add an event to repeatedly check if a parameter isn't the double precision floating point value.
The event is triggered by calling check_expected_double() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value | The value to check. | |
| [in] | epsilon | The epsilon used as margin for double comparison. | |
| [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. |
| void expect_not_float | ( | # | function, |
| # | parameter, | ||
| double | value, | ||
| double | epsilon ) |
Add an event to check if a parameter isn't the given floating point value.
The event is triggered by calling check_expected_float() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value | The value to check. | |
| [in] | epsilon | The epsilon used as margin for float comparison. |
| void expect_not_float_count | ( | # | function, |
| # | parameter, | ||
| double | value, | ||
| double | epsilon, | ||
| size_t | count ) |
Add an event to repeatedly check if a parameter isn't the floating point value.
The event is triggered by calling check_expected_float() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value | The value to check. | |
| [in] | epsilon | The epsilon used as margin for float comparison. | |
| [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. |
| void expect_not_in_range | ( | # | function, |
| # | parameter, | ||
| uintmax_t | minimum, | ||
| uintmax_t | maximum ) |
Add an event to check a parameter is outside a numerical range. The check would succeed if minimum > value > maximum.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | minimum | The lower boundary of the interval to check against. | |
| [in] | maximum | The upper boundary of the interval to check against. |
| void expect_not_in_range_count | ( | # | function, |
| # | parameter, | ||
| uintmax_t | minimum, | ||
| uintmax_t | maximum, | ||
| size_t | count ) |
Add an event to repeatedly check a parameter is outside a numerical range. The check would succeed if minimum > value > maximum.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | minimum | The lower boundary of the interval to check against. | |
| [in] | maximum | The upper boundary of the interval to check against. | |
| [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. |
| void expect_not_in_set | ( | # | function, |
| # | parameter, | ||
| uintmax_t | value_array[] ) |
| void expect_not_in_set_count | ( | # | function, |
| # | parameter, | ||
| uintmax_t | value_array[], | ||
| size_t | count ) |
| void expect_not_memory | ( | # | function, |
| # | parameter, | ||
| void * | memory, | ||
| size_t | size ) |
Add an event to check if the parameter doesn't match an area of memory.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | memory | The memory to compare. | |
| [in] | size | The size of the memory to compare. |
| void expect_not_memory_count | ( | # | function, |
| # | parameter, | ||
| void * | memory, | ||
| size_t | size, | ||
| size_t | count ) |
Add an event to repeatedly check if the parameter doesn't match an area of memory.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | memory | The memory to compare. | |
| [in] | size | The size of the memory to compare. | |
| [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. |
| void expect_not_string | ( | # | function, |
| # | parameter, | ||
| const char * | string ) |
Add an event to check if the parameter value isn't equal to the provided string.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | string | The string value to compare. |
| void expect_not_string_count | ( | # | function, |
| # | parameter, | ||
| const char * | string, | ||
| size_t | count ) |
Add an event to check if the parameter value isn't equal to the provided string.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | string | The string value to compare. | |
| [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. |
| void expect_not_value | ( | # | function, |
| # | parameter, | ||
| uintmax_t | value ) |
| void expect_not_value_count | ( | # | function, |
| # | parameter, | ||
| uintmax_t | value, | ||
| size_t | count ) |
| void expect_string | ( | # | function, |
| # | parameter, | ||
| const char * | string ) |
Add an event to check if the parameter value is equal to the provided string.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | string | The string value to compare. |
| void expect_string_count | ( | # | function, |
| # | parameter, | ||
| const char * | string, | ||
| size_t | count ) |
Add an event to check if the parameter value is equal to the provided string.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | string | The string value to compare. | |
| [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. |
| void expect_uint_in_range | ( | # | function, |
| uintmax_t | minimum, | ||
| uintmax_t | maximum ) |
Add an event to check an unsigned integer parameter is inside a numerical range. The check would succeed if minimum <= value <= maximum.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | minimum | The lower boundary of the interval to check against. | |
| [in] | maximum | The upper boundary of the interval to check against. |
| void expect_uint_in_range_count | ( | # | function, |
| uintmax_t | minimum, | ||
| uintmax_t | maximum, | ||
| size_t | count ) |
Add an event to repeatedly check an unsigned integer parameter is inside a numerical range. The check would succeed if minimum <= value <= maximum.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | minimum | The lower boundary of the interval to check against. | |
| [in] | maximum | The upper boundary of the interval to check against. | |
| [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. |
| void expect_uint_in_set_count | ( | # | function, |
| # | parameter, | ||
| uintmax_t | value_array[], | ||
| size_t | count ) |
Add an event to check if the parameter value is part of the provided unsigned integer array.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value_array[] | The array to check for the value. | |
| [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. |
| void expect_uint_not_in_range | ( | # | function, |
| uintmax_t | minimum, | ||
| uintmax_t | maximum ) |
Add an event to check an unsigned integer parameter is outside a numerical range. The check would succeed if minimum > value > maximum.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | minimum | The lower boundary of the interval to check against. | |
| [in] | maximum | The upper boundary of the interval to check against. |
| void expect_uint_not_in_range_count | ( | # | function, |
| uintmax_t | minimum, | ||
| uintmax_t | maximum, | ||
| size_t | count ) |
Add an event to repeatedly check an unsigned integer parameter is outside a numerical range. The check would succeed if minimum > value > maximum.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | minimum | The lower boundary of the interval to check against. | |
| [in] | maximum | The upper boundary of the interval to check against. | |
| [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. |
| void expect_uint_not_in_set | ( | # | function, |
| # | parameter, | ||
| uintmax_t | value_array[] ) |
Add an event to check if the unsigned integer parameter value is not part of the provided unsigned integer array.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value_array[] | The array to check for the value. |
| void expect_uint_not_in_set_count | ( | # | function, |
| uintmax_t | value_array[], | ||
| size_t | count ) |
Add an event to check if the unsigned integer parameter value is not part of the provided unsigned integer array.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value_array[] | The array to check for the value. | |
| [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. |
| void expect_uint_not_value | ( | # | function, |
| # | parameter, | ||
| uintmax_t | value ) |
Add an event to check if a parameter (uint) isn't the given value.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value | The value (uintmax_t) to check. |
| void expect_uint_not_value_count | ( | # | function, |
| uintmax_t | value, | ||
| size_t | count ) |
Add an event to repeatedly check if a parameter (uint) isn't the given value.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value | The value (uintmax_t) to check. | |
| [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. |
| void expect_uint_value | ( | # | function, |
| # | parameter, | ||
| uintmax_t | value ) |
Add an event to check if an unsigned integer parameter is the given value.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value | The value to check. |
| void expect_uint_value_count | ( | # | function, |
| uintmax_t | value, | ||
| size_t | count ) |
Add an event to repeatedly check if an unsigned integer parameter is the given value.
The event is triggered by calling check_expected() in the mocked function.
| [in] | function | The function to add the check for. | |
| [in] | parameter | The name of the parameter passed to the function. | |
| [in] | value | The value to check. | |
| [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. |
| void expect_value | ( | # | function, |
| # | parameter, | ||
| uintmax_t | value ) |
| void expect_value_count | ( | # | function, |
| # | parameter, | ||
| uintmax_t | value, | ||
| size_t | count ) |