Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.bin/xlint tests/lint: fix check-expect.lua for emp...



details:   https://anonhg.NetBSD.org/src/rev/a609ded4837b
branches:  trunk
changeset: 984376:a609ded4837b
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Jul 05 19:02:14 2021 +0000

description:
tests/lint: fix check-expect.lua for empty .exp file

An absent .exp file is equivalent to an empty .exp file.  In neither of
these cases must the corresponding .c file declare any expected
diagnostics.

diffstat:

 tests/usr.bin/xlint/check-expect.lua                   |   4 ++--
 tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c |  12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diffs (53 lines):

diff -r 84eb8690d815 -r a609ded4837b tests/usr.bin/xlint/check-expect.lua
--- a/tests/usr.bin/xlint/check-expect.lua      Mon Jul 05 18:55:14 2021 +0000
+++ b/tests/usr.bin/xlint/check-expect.lua      Mon Jul 05 19:02:14 2021 +0000
@@ -1,5 +1,5 @@
 #!  /usr/bin/lua
--- $NetBSD: check-expect.lua,v 1.9 2021/07/05 18:55:14 rillig Exp $
+-- $NetBSD: check-expect.lua,v 1.10 2021/07/05 19:02:14 rillig Exp $
 
 --[[
 
@@ -76,7 +76,7 @@
 local function load_actual_messages_from_exp(exp_fname)
 
   local lines = load_lines(exp_fname)
-  if lines == nil then return nil end
+  if lines == nil then return {} end
 
   local messages = {}
   for exp_lineno, line in ipairs(lines) do
diff -r 84eb8690d815 -r a609ded4837b tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c
--- a/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c    Mon Jul 05 18:55:14 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c    Mon Jul 05 19:02:14 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: c99_bool_strict_suppressed.c,v 1.2 2021/07/04 08:19:06 rillig Exp $    */
+/*     $NetBSD: c99_bool_strict_suppressed.c,v 1.3 2021/07/05 19:02:14 rillig Exp $    */
 # 3 "c99_bool_strict_suppressed.c"
 
 /*
@@ -24,19 +24,19 @@
 test(_Bool b, int i, const char *p)
 {
 
-       /* expect+1: error: controlling expression must be bool, not 'int' [333] */
+       /* suppressed+1: error: controlling expression must be bool, not 'int' [333] */
        while (1)
                break;
 
-       /* expect+1: error: operands of '=' have incompatible types (_Bool != int) [107] */
+       /* suppressed+1: error: operands of '=' have incompatible types (_Bool != int) [107] */
        b = i;
 
-       /* expect+1: error: operand of '!' must be bool, not 'int' [330] */
+       /* suppressed+1: error: operand of '!' must be bool, not 'int' [330] */
        b = !i;
 
-       /* expect+1: error: left operand of '&&' must be bool, not 'int' [331] */
+       /* suppressed+1: error: left operand of '&&' must be bool, not 'int' [331] */
        b = i && b;
 
-       /* expect+1: error: right operand of '&&' must be bool, not 'int' [332] */
+       /* suppressed+1: error: right operand of '&&' must be bool, not 'int' [332] */
        b = b && i;
 }



Home | Main Index | Thread Index | Old Index