doc: Document test_calloc().
authorAndreas Schneider <asn@cryptomilk.org>
Fri, 16 Nov 2012 12:58:18 +0000 (13:58 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 16 Nov 2012 12:58:18 +0000 (13:58 +0100)
include/cmocka.h

index b7b0f7de63dc305b3b021e6a566817f754bfb997..abde7f5dd4724a8fd117f5f41673db632008c7ed 100755 (executable)
@@ -797,7 +797,25 @@ void *test_malloc(size_t size);
 #define test_malloc(size) _test_malloc(size, __FILE__, __LINE__)
 #endif
 
+#ifdef DOXYGEN
+/**
+ * @brief Test function overriding calloc.
+ *
+ * The memory is set to zero.
+ *
+ * @param[in]  nmemb  The number of elements for an array to be allocated.
+ *
+ * @param[in]  size   The size in bytes of each array element to allocate.
+ *
+ * @return A pointer to the allocated memory, NULL on error.
+ *
+ * @see calloc(3)
+ */
+void *test_calloc(size_t nmemb, size_t size);
+#else
 #define test_calloc(num, size) _test_calloc(num, size, __FILE__, __LINE__)
+#endif
+
 #define test_free(ptr) _test_free(ptr, __FILE__, __LINE__)
 
 /* Redirect malloc, calloc and free to the unit test allocators. */