]> granicus.if.org Git - check/commitdiff
Add documentation for ck_assert_ptr_null and ck_assert_ptr_nonnull macros
authorDotsenko Andrey <cnconlinux@gmail.com>
Tue, 13 Dec 2016 04:44:36 +0000 (07:44 +0300)
committerDotsenko Andrey <cnconlinux@gmail.com>
Tue, 13 Dec 2016 17:42:37 +0000 (20:42 +0300)
doc/check.texi

index 3af9ada552c32c0165afede48b28cd1b0cb3d284..9d0fa22a7659141a242a0294c2fb842e64958f25 100644 (file)
@@ -1223,6 +1223,17 @@ used for comparison is different for each function and is indicated by
 the last two letters of the function name.  The abbreviations @code{eq} and
 @code{ne} correspond to @code{==} and @code{!=} respectively.
 
+@item ck_assert_ptr_null
+@itemx ck_assert_ptr_nonnull
+
+Compares a pointers against null and displays predefined message with
+condition and value of the input parameter on failure.
+@code{ck_assert_ptr_null} checks that pointer is equal to NULL and
+@code{ck_assert_ptr_nonnull} checks that pointer is not equal to NULL.
+@code{ck_assert_ptr_nonnull} is highly recommended to use in situations
+when a function call can return NULL as error indication (like functions
+that use malloc, calloc, strdup, mmap, etc).
+
 @item ck_assert_mem_eq
 @itemx ck_assert_mem_ne
 @itemx ck_assert_mem_lt