doc: Add section for checking parameters.
authorAndreas Schneider <asn@cryptomilk.org>
Fri, 30 Nov 2012 15:59:24 +0000 (16:59 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 30 Nov 2012 15:59:24 +0000 (16:59 +0100)
include/cmocka.h

index a37d2c71c7c95612abad7ca95440112aa73bdd8a..a9022aa04263b070a3ee01a3119ddd6474a5d951 100755 (executable)
@@ -203,6 +203,26 @@ void will_return_count(#function, void *value, int count);
 
 /** @} */
 
+/**
+ * @defgroup cmocka_param Checking Parameters
+ * @ingroup cmocka
+ *
+ * Functionality to store expected values for mock function parameters.
+ *
+ * In addition to storing the return values of mock functions, cmocka provides
+ * functionality to store expected values for mock function parameters using
+ * the expect_*() functions provided. A mock function parameter can then be
+ * validated using the check_expected() macro.
+ *
+ * Successive calls to expect_*() macros for a parameter queues values to check
+ * the specified parameter. check_expected() checks a function parameter
+ * against the next value queued using expect_*(), if the parameter check fails
+ * a test failure is signalled. In addition if check_expected() is called and
+ * no more parameter values are queued a test failure occurs.
+ *
+ * @{
+ */
+
 /*
  * Add a custom parameter checking function.  If the event parameter is NULL
  * the event structure is allocated internally by this function.  If event
@@ -319,6 +339,8 @@ void will_return_count(#function, void *value, int count);
     _check_expected(__func__, #parameter, __FILE__, __LINE__, \
                     cast_to_largest_integral_type(parameter))
 
+/** @} */
+
 /**
  * @defgroup cmocka_asserts Assert Macros
  * @ingroup cmocka