Module Name:    src
Committed By:   rillig
Date:           Sun Feb 28 01:20:54 UTC 2021

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

Log Message:
tests/lint: force 'expect' annotations


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/check-expect.lua
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_135.c \
    src/tests/usr.bin/xlint/lint1/msg_153.c \
    src/tests/usr.bin/xlint/lint1/msg_229.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.5 src/tests/usr.bin/xlint/check-expect.lua:1.6
--- src/tests/usr.bin/xlint/check-expect.lua:1.5	Sat Feb 27 17:16:48 2021
+++ src/tests/usr.bin/xlint/check-expect.lua	Sun Feb 28 01:20:54 2021
@@ -1,5 +1,5 @@
 #!  /usr/bin/lua
--- $NetBSD: check-expect.lua,v 1.5 2021/02/27 17:16:48 rillig Exp $
+-- $NetBSD: check-expect.lua,v 1.6 2021/02/28 01:20:54 rillig Exp $
 
 --[[
 
@@ -90,9 +90,11 @@ end
 
 local function check_test(c_fname, errors)
   local exp_fname = c_fname:gsub("%.c$", ".exp")
+
   local comment_linenos, comments_by_lineno =
     load_expect_comments_from_c(c_fname, errors)
-  if comment_linenos == nil or #comment_linenos == 0 then return end
+  if comment_linenos == nil then return end
+
   local messages = load_actual_messages_from_exp(exp_fname)
   if messages == nil then return end
 

Index: src/tests/usr.bin/xlint/lint1/msg_135.c
diff -u src/tests/usr.bin/xlint/lint1/msg_135.c:1.4 src/tests/usr.bin/xlint/lint1/msg_135.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_135.c:1.4	Sun Feb 28 00:40:22 2021
+++ src/tests/usr.bin/xlint/lint1/msg_135.c	Sun Feb 28 01:20:54 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_135.c,v 1.4 2021/02/28 00:40:22 rillig Exp $	*/
+/*	$NetBSD: msg_135.c,v 1.5 2021/02/28 01:20:54 rillig Exp $	*/
 # 3 "msg_135.c"
 
 // Test for message: converting '%s' to '%s' may cause alignment problem [135]
@@ -10,7 +10,7 @@ read_uint(const unsigned char **pp)
 {
 	unsigned val;
 
-	val = *(const unsigned *)(*pp);
+	val = *(const unsigned *)(*pp);	/* expect: 135 */
 	pp += sizeof(unsigned);
 	return val;
 }
Index: src/tests/usr.bin/xlint/lint1/msg_153.c
diff -u src/tests/usr.bin/xlint/lint1/msg_153.c:1.4 src/tests/usr.bin/xlint/lint1/msg_153.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_153.c:1.4	Sun Feb 28 01:06:57 2021
+++ src/tests/usr.bin/xlint/lint1/msg_153.c	Sun Feb 28 01:20:54 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_153.c,v 1.4 2021/02/28 01:06:57 rillig Exp $	*/
+/*	$NetBSD: msg_153.c,v 1.5 2021/02/28 01:20:54 rillig Exp $	*/
 # 3 "msg_153.c"
 
 // Test for message: converting '%s' to incompatible '%s' for argument %d [153]
@@ -12,11 +12,11 @@ void sink_int_pointer(int *);
 void
 to_function_pointer(int *x)
 {
-	sink_function_pointer(x);
+	sink_function_pointer(x);	/* expect: 153 */
 }
 
 void
 to_int_pointer(unary_operator op)
 {
-	sink_int_pointer(op);
+	sink_int_pointer(op);		/* expect: 153 */
 }
Index: src/tests/usr.bin/xlint/lint1/msg_229.c
diff -u src/tests/usr.bin/xlint/lint1/msg_229.c:1.4 src/tests/usr.bin/xlint/lint1/msg_229.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_229.c:1.4	Sun Feb 28 01:06:57 2021
+++ src/tests/usr.bin/xlint/lint1/msg_229.c	Sun Feb 28 01:20:54 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_229.c,v 1.4 2021/02/28 01:06:57 rillig Exp $	*/
+/*	$NetBSD: msg_229.c,v 1.5 2021/02/28 01:20:54 rillig Exp $	*/
 # 3 "msg_229.c"
 
 // Test for message: converting '%s' to '%s' is questionable [229]
@@ -8,11 +8,11 @@ typedef double (*unary_operator)(double)
 int *
 to_int_pointer(unary_operator op)
 {
-	return (int *)op;
+	return (int *)op;		/* expect: 229 */
 }
 
 unary_operator
 to_function_pointer(int *p)
 {
-	return (unary_operator)p;
+	return (unary_operator)p;	/* expect: 229 */
 }

Reply via email to