On 17:56:14 2019-06-09, Jani Nikula wrote:
On Sun, 09 Jun 2019, Bruno Santos <brunomanuelsantos@xxxxxxxxxxxxxxxxxx>
wrote:
This covers two common scenarios for the same expected result. '(void)'
and '()'. This should catch issues like issue #14.
---
test/example-70-function.c | 10 ++++++++++
test/example-70-function.rst | 10 ++++++++++
I've tried to say before (but I've not, uh, actually documented this
anywhere, *blush*) that I'd like the example-* test cases to demonstrate
the best practice of documentation. They also get included in the
generated documentation.
All the corner cases, rainy day scenarios, etc. should be in the
non-example test cases. I think the empty parameter list version should
go into function.c, just to test the case, possibly with a comment not
to do this. And the frobonize(void) version could remain in
example-70-function.c.
Otherwise, looks good.
BR,
Jani.
2 files changed, 20 insertions(+)
diff --git a/test/example-70-function.c b/test/example-70-function.c
index 5042b07..50cb234 100644
--- a/test/example-70-function.c
+++ b/test/example-70-function.c
@@ -15,3 +15,13 @@ int frob(struct list *list, enum mode mode);
* :param ...: variadic
*/
int frobo(const char *fmt, ...);
+
+/**
+ * Void parameter.
+ */
+int frobonize(void);
+
+/**
+ * Empty parameters.
+ */
+int froboation();
diff --git a/test/example-70-function.rst b/test/example-70-function.rst
index acdfe98..69a0981 100644
--- a/test/example-70-function.rst
+++ b/test/example-70-function.rst
@@ -16,3 +16,13 @@
:param fmt: the format
:param ...: variadic
+
+.. c:function:: int frobonize()
+
+ Void parameter.
+
+
+.. c:function:: int froboation()
+
+ Empty parameters.
+
--
2.21.0