Crinit -- Configurable Rootfs Init
|
Header for common definitions/includes specifically for cmocka unit tests. More...
#include <setjmp.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <cmocka.h>
Go to the source code of this file.
Macros | |
#define | ARRAY_SIZE(array) (sizeof(array) / sizeof(*(array))) |
#define | cast_to_largest_integral_type(value) cast_to_uintmax_type(value) |
#define | check_expected_dynamic(parameter_string, value) _check_expected(__func__, parameter_string, __FILE__, __LINE__, cast_to_largest_integral_type(value)) |
#define | will_set_parameter(METHOD, PARAM_NAME, VALUE) will_return(METHOD, VALUE) |
Header for common definitions/includes specifically for cmocka unit tests.
#define ARRAY_SIZE | ( | array | ) | (sizeof(array) / sizeof(*(array))) |
#define cast_to_largest_integral_type | ( | value | ) | cast_to_uintmax_type(value) |
#define check_expected_dynamic | ( | parameter_string, | |
value | |||
) | _check_expected(__func__, parameter_string, __FILE__, __LINE__, cast_to_largest_integral_type(value)) |
Determine whether a function parameter is correct.
This ensures the next value queued by one of the expect_*() macros matches the specified value. In contrast to check_expected(), this function takes the parameter name as a string that can be created at runtime.
This function needs to be called in the mock object.
#define will_set_parameter | ( | METHOD, | |
PARAM_NAME, | |||
VALUE | |||
) | will_return(METHOD, VALUE) |
CMocka macro to be used to mock return paramters.