Module Name:    src
Committed By:   rillig
Date:           Mon Jul  5 19:02:14 UTC 2021

Modified Files:
        src/tests/usr.bin/xlint: check-expect.lua
        src/tests/usr.bin/xlint/lint1: c99_bool_strict_suppressed.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/xlint/check-expect.lua
cvs rdiff -u -r1.2 -r1.3 \
    src/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/xlint/check-expect.lua
diff -u src/tests/usr.bin/xlint/check-expect.lua:1.9 src/tests/usr.bin/xlint/check-expect.lua:1.10
--- src/tests/usr.bin/xlint/check-expect.lua:1.9	Mon Jul  5 18:55:14 2021
+++ src/tests/usr.bin/xlint/check-expect.lua	Mon Jul  5 19:02:14 2021
@@ -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 @@ end
 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

Index: src/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c
diff -u src/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c:1.2 src/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c:1.3
--- src/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c:1.2	Sun Jul  4 08:19:06 2021
+++ src/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c	Mon Jul  5 19:02:14 2021
@@ -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 @@ void
 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;
 }

Reply via email to