summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2024-01-07 20:37:45 +0100
committerAndreas Schneider <asn@cryptomilk.org>2024-02-02 11:21:34 +0100
commit390b9c18956b9516e11261615bd16c70060c765f (patch)
tree44f450fc4b945c43b0224a845f1868ab3eed044e
parent722c7ad5efbf4cef17b9fc606cf983d71dfc92e9 (diff)
downloadcmocka-390b9c18956b9516e11261615bd16c70060c765f.zip
cmocka-390b9c18956b9516e11261615bd16c70060c765f.tar.gz
cmocka-390b9c18956b9516e11261615bd16c70060c765f.tar.bz2
cmocka: Get rid of _expect_in_set()
-rw-r--r--include/cmocka.h15
-rw-r--r--src/cmocka.c16
2 files changed, 8 insertions, 23 deletions
diff --git a/include/cmocka.h b/include/cmocka.h
index d53aad6..3e7f771 100644
--- a/include/cmocka.h
+++ b/include/cmocka.h
@@ -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,
diff --git a/src/cmocka.c b/src/cmocka.c
index e82e7bb..338579c 100644
--- a/src/cmocka.c
+++ b/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,