cmocka 2.0 released
Date:
Thu, 04 Dec 2025 14:09:54 +0000
Description:
Andreas Schneider has announced
version 2.0 of the cmocka unit-testing framework for C: This release represents a major modernization effort, bringing
cmocka firmly into the "modern" C99 era while maintaining the
simplicity and ease of use that users have come to expect. One of the most significant changes in cmocka 2.0 is the migration
to C99 standard integer types. The LargestIntegralType typedef has
been replaced with intmax_t and uintmax_t from stdint .h, providing better type safety and portability across
different platforms. Additionally, we've adopted the bool type where appropriate, making the code more expressive and self-documenting. Using intmax_t and uintmax_t also allows to print
better error messages. So you can now find
e.g. assert_int_equal and assert_uint_equal . cmocka 2.0 introduces a comprehensive set of type-specific
assertion macros, including `assert_uint_equal()`,
`assert_float_equal()`, and enhanced pointer assertions. The mocking
system has also been significantly improved with type-specific macros
like `will_return_int()` and `will_return_float()`. The same for
parameter checking etc. LWN covered the
project early in its development in 2013. See the full list of new
features, enhancements, and bug fixes in cmocka 2.0 in the changelog .
======================================================================
Link to news story:
https://lwn.net/Articles/1049199/
--- Mystic BBS v1.12 A49 (Linux/64)
* Origin: tqwNet UK HUB @ hub.uk.erb.pw (1337:1/100)