cmocka: Get rid of _expect_in_set()
This commit is contained in:
parent
722c7ad5ef
commit
390b9c1895
|
@ -942,9 +942,14 @@ void expect_in_set(#function, #parameter, intmax_t value_array[]);
|
|||
*/
|
||||
void expect_in_set_count(#function, #parameter, uintmax_t value_array[], size_t count);
|
||||
#else
|
||||
#define expect_in_set_count(function, parameter, value_array, count) \
|
||||
_expect_in_set(cmocka_tostring(function), cmocka_tostring(parameter), __FILE__, __LINE__, value_array, \
|
||||
sizeof(value_array) / sizeof((value_array)[0]), count)
|
||||
#define expect_in_set_count(function, parameter, value_array, count) \
|
||||
_expect_uint_in_set(cmocka_tostring(function), \
|
||||
cmocka_tostring(parameter), \
|
||||
__FILE__, \
|
||||
__LINE__, \
|
||||
value_array, \
|
||||
sizeof(value_array) / sizeof((value_array)[0]), \
|
||||
count)
|
||||
#endif
|
||||
|
||||
#ifdef DOXYGEN
|
||||
|
@ -2968,10 +2973,6 @@ void _expect_check(
|
|||
const CMockaValueData check_data, CheckParameterEvent * const event,
|
||||
const int count);
|
||||
|
||||
void _expect_in_set(
|
||||
const char* const function, const char* const parameter,
|
||||
const char* const file, const int line, const uintmax_t values[],
|
||||
const size_t number_of_values, const int count);
|
||||
void _expect_int_in_set(const char *const function,
|
||||
const char *const parameter,
|
||||
const char *const file,
|
||||
|
|
16
src/cmocka.c
16
src/cmocka.c
|
@ -1685,13 +1685,6 @@ static int memory_not_equal_display_error(
|
|||
|
||||
|
||||
/* CheckParameterValue callback to check whether a value is within a set. */
|
||||
static int check_in_set(const CMockaValueData value,
|
||||
const CMockaValueData check_value_data) {
|
||||
return value_in_set_display_error(value.uint_val,
|
||||
cast_cmocka_value_to_pointer(CheckIntegerSet*,
|
||||
check_value_data), 0);
|
||||
}
|
||||
|
||||
static int check_int_in_set(const CMockaValueData value,
|
||||
const CMockaValueData check_value_data) {
|
||||
return int_value_in_set_display_error(
|
||||
|
@ -1812,15 +1805,6 @@ static void __expect_uint_in_set(const char *const function,
|
|||
}
|
||||
|
||||
/* Add an event to check whether a value is in a set. */
|
||||
void _expect_in_set(
|
||||
const char* const function, const char* const parameter,
|
||||
const char* const file, const int line,
|
||||
const uintmax_t values[], const size_t number_of_values,
|
||||
const int count) {
|
||||
expect_set(function, parameter, file, line, values, number_of_values,
|
||||
check_in_set, count);
|
||||
}
|
||||
|
||||
void _expect_int_in_set(const char *const function,
|
||||
const char *const parameter,
|
||||
const char *const file,
|
||||
|
|
Loading…
Reference in New Issue