bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: Re: error, verror: Add tests
Date: Thu, 12 Jan 2023 16:56:22 +0100	[thread overview]
Message-ID: <2366769.aiPYRZItUj@nimes> (raw)
In-Reply-To: <3640038.8FI41Ny9JD@nimes>

> 2023-01-12  Bruno Haible  <bruno@clisp.org>
> 
> 	verror: Add tests.
> 	* tests/test-verror.sh: New file, based on tests/test-error.sh.
> 	* tests/test-verror.c: New file, based on tests/test-error.c.
> 	* modules/verror-tests: New file.
> 
> 2023-01-12  Bruno Haible  <bruno@clisp.org>
> 
> 	error: Add tests.
> 	* tests/test-error.sh: New file.
> 	* tests/test-error.c: New file.
> 	* modules/error-tests: New file.

Note that the tests do *not* test the situation of error_at_line with a NULL
file name argument, since this is not described as supported in the glibc
documentation.


2023-01-12  Bruno Haible  <bruno@clisp.org>

	error, verror tests: Add clarification.
	* tests/test-error.c (main): Clarify why we don't test error_at_line
	with a NULL filename.
	* tests/test-verror.c (main): Clarify why we don't test verror_at_line
	with a NULL filename.

diff --git a/tests/test-error.c b/tests/test-error.c
index 67600d34f9..697e783eee 100644
--- a/tests/test-error.c
+++ b/tests/test-error.c
@@ -66,6 +66,10 @@ main (int argc, char *argv[])
   error_print_progname = print_no_progname;
   error (0, 0, "hammer");
   error (0, 0, "boing %d%d%d is too large", 1, 2, 3);
+  #if 0
+  /* The documentation does not describe the output if the file name is NULL. */
+  error_at_line (0, 0, NULL, 42, "drummer too loud");
+  #endif
   error_at_line (0, 0, "d2/bar.c", 11, "bark too loud");
   /* Verify error_message_count.  */
   ASSERT (error_message_count == 11);
diff --git a/tests/test-verror.c b/tests/test-verror.c
index c5a62cddec..7c808d7908 100644
--- a/tests/test-verror.c
+++ b/tests/test-verror.c
@@ -109,6 +109,10 @@ main (int argc, char *argv[])
   error_print_progname = print_no_progname;
   test_zero ("hammer");
   test_zero ("boing %d%d%d is too large", 1, 2, 3);
+  #if 0
+  /* The documentation does not describe the output if the file name is NULL. */
+  test_zero_at_line (NULL, 42, "drummer too loud");
+  #endif
   test_zero_at_line ("d2/bar.c", 11, "bark too loud");
   /* Verify error_message_count.  */
   ASSERT (error_message_count == 11);





  reply	other threads:[~2023-01-12 15:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-12 11:42 error, verror: Add tests Bruno Haible
2023-01-12 15:56 ` Bruno Haible [this message]
2023-01-14 19:32 ` Bruno Haible

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2366769.aiPYRZItUj@nimes \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).