diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2024-01-06 14:15:28 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2024-02-02 11:21:34 +0100 |
commit | 669b05fef6eb18224567eb616a549b921e22da91 (patch) | |
tree | 1c7691c997ab91caaf1b8f99e5ee17f2f1425e8c | |
parent | 6d934950503b6548d735524730be31f2cf2ba7d8 (diff) | |
download | cmocka-669b05fef6eb18224567eb616a549b921e22da91.zip cmocka-669b05fef6eb18224567eb616a549b921e22da91.tar.gz cmocka-669b05fef6eb18224567eb616a549b921e22da91.tar.bz2 |
cmocka: Add expect_uint_in_set_count()
-rw-r--r-- | include/cmocka.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/include/cmocka.h b/include/cmocka.h index 5db0db2..37bb488 100644 --- a/include/cmocka.h +++ b/include/cmocka.h @@ -959,6 +959,37 @@ void expect_int_in_set_count(#function, #parameter, intmax_t value_array[], size #ifdef DOXYGEN /** + * @brief 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. + * + * @param[in] #function The function to add the check for. + * + * @param[in] #parameter The name of the parameter passed to the function. + * + * @param[in] value_array[] The array to check for the value. + * + * @param[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. + * + * @see check_expected(). + */ +void expect_int_in_set_count(#function, #parameter, uintmax_t value_array[], size_t count); +#else +#define expect_uint_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 +/** * @brief Add an event to check if the parameter value is not part of the * provided array. * |