[hawkmoth] Re: [PATCH 2/2] test: cover cases of functions with no parameters

  • From: Bruno Santos <brunomanuelsantos@xxxxxxxxxxxxxxxxxx>
  • To: hawkmoth@xxxxxxxxxxxxx
  • Date: Sun, 9 Jun 2019 16:04:28 +0100

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.

Hey,

Yeah, you're right. And I actually knew that already, I was just sloppy.
I'll push a fix.

Cheers,
Bruno


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


Other related posts: