[hawkmoth] Re: [PATCH 11/11] test: remove clang warning from documentation build

  • From: "Bruno Santos" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "brunomanuelsantos" for DMARC)
  • To: hawkmoth@xxxxxxxxxxxxx
  • Date: Fri, 18 Dec 2020 15:58:21 +0000

On 21:00:08 2020-12-15, Jani Nikula wrote:

Stop using an unknown type in the test:

doc/examples.rst:127: WARNING: doc/examples/example-50-struct.c:9: unknown 
type name 'list_data_t'

Instead of failing, this caused the type to default to int, which is
what the test expectation is instead of list_data_t! Change the source
to int as well.

I don't oppose this in the sense that this is a test about structs, not
about error handling, but the latter are also important tests. The one
thing I would note though is that there are similar cases besides this
one (just look for other `stderr` files).

Maybe we should remove all of them and create separate tests that
specifically for error handling capabilities and named accordingly? Up
to you really.

Great series by the way! This was a much needed update :)

Bruno

---
 test/example-50-struct.c      | 2 +-
 test/example-50-struct.stderr | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)
 delete mode 100644 test/example-50-struct.stderr

diff --git a/test/example-50-struct.c b/test/example-50-struct.c
index 550f1131916d..3f919900c4b8 100644
--- a/test/example-50-struct.c
+++ b/test/example-50-struct.c
@@ -6,5 +6,5 @@ struct list {
      struct list *next;
 
      /** Data. */
-     list_data_t data;
+     int data;
 };
diff --git a/test/example-50-struct.stderr b/test/example-50-struct.stderr
deleted file mode 100644
index ea95c389e2b9..000000000000
--- a/test/example-50-struct.stderr
+++ /dev/null
@@ -1 +0,0 @@
-ERROR: 9: unknown type name 'list_data_t'

Other related posts: