From 596df411bc543c53fe90d6b53154ea4a872bb6a5 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 17 Oct 2012 17:27:37 +0200 Subject: include: Document assert_non_null(). --- include/cmocka.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/cmocka.h b/include/cmocka.h index efb472f..c3b50f7 100755 --- a/include/cmocka.h +++ b/include/cmocka.h @@ -366,9 +366,23 @@ void assert_false(scalar expression); __FILE__, __LINE__) #endif -/* Assert that the given pointer is non-NULL. */ +#ifdef DOXYGEN +/** + * @brief Assert that the given pointer is non-NULL. + * + * The function prints an error message to standard error and terminates the + * test by calling fail() if the pointer is non-NULL. + * + * @param[in] pointer The pointer to evaluate. + * + * @see assert_null() + */ +void assert_non_null(void *pointer); +#else #define assert_non_null(c) _assert_true(cast_ptr_to_largest_integral_type(c), #c, \ -__FILE__, __LINE__) + __FILE__, __LINE__) +#endif + /* Assert that the given pointer is NULL. */ #define assert_null(c) _assert_true(!(cast_ptr_to_largest_integral_type(c)), #c, \ __FILE__, __LINE__) -- cgit v1.2.3