From b95dc47291b5890653bc75169b1d38b5760ca1ea Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 12 Jan 2023 16:39:21 +0100 Subject: [PATCH] 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. --- ChangeLog | 8 ++++++++ tests/test-error.c | 4 ++++ tests/test-verror.c | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index 07f525af08..4a3480b631 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2023-01-12 Bruno Haible + + 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. + 2023-01-12 Bruno Haible verror: Add tests. 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); -- 2.39.5