Module Name:    src
Committed By:   rillig
Date:           Thu Dec 16 20:23:40 UTC 2021

Modified Files:
        src/tests/usr.bin/xlint/lint1: msg_230_uchar.c msg_230_uchar.exp

Log Message:
tests/lint: fix test on platforms where char is unsigned

In tree.c 1.385 from 2021-10-09, the format of the message changed.  The
test for platforms where char is unsigned was not updated in that commit
because I had forgotten about it, and because lint1/check-msgs.lua only
checks the message in tests named exacty msg_000.c, but not msg_000_*.c.

Found by martin@.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_230_uchar.c
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_230_uchar.exp

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/lint1/msg_230_uchar.c
diff -u src/tests/usr.bin/xlint/lint1/msg_230_uchar.c:1.4 src/tests/usr.bin/xlint/lint1/msg_230_uchar.c:1.5
--- src/tests/usr.bin/xlint/lint1/msg_230_uchar.c:1.4	Sat Aug 28 15:25:10 2021
+++ src/tests/usr.bin/xlint/lint1/msg_230_uchar.c	Thu Dec 16 20:23:40 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_230_uchar.c,v 1.4 2021/08/28 15:25:10 rillig Exp $	*/
+/*	$NetBSD: msg_230_uchar.c,v 1.5 2021/12/16 20:23:40 rillig Exp $	*/
 # 3 "msg_230_uchar.c"
 
 // Test for message: nonportable character comparison, op %s [230]
@@ -19,26 +19,26 @@
 void
 compare_plain_char(char c)
 {
-	/* expect+1: warning: nonportable character comparison, op == [230] */
+	/* expect+1: warning: nonportable character comparison '== -129' [230] */
 	if (c == -129)
 		return;
-	/* expect+1: warning: nonportable character comparison, op == [230] */
+	/* expect+1: warning: nonportable character comparison '== -128' [230] */
 	if (c == -128)
 		return;
-	/* expect+1: warning: nonportable character comparison, op == [230] */
+	/* expect+1: warning: nonportable character comparison '== -1' [230] */
 	if (c == -1)
 		return;
 	if (c == 0)
 		return;
 	if (c == 127)
 		return;
-	/* expect+1: warning: nonportable character comparison, op == [230] */
+	/* expect+1: warning: nonportable character comparison '== 128' [230] */
 	if (c == 128)
 		return;
-	/* expect+1: warning: nonportable character comparison, op == [230] */
+	/* expect+1: warning: nonportable character comparison '== 255' [230] */
 	if (c == 255)
 		return;
-	/* expect+1: warning: nonportable character comparison, op == [230] */
+	/* expect+1: warning: nonportable character comparison '== 256' [230] */
 	if (c == 256)
 		return;
 }
@@ -46,26 +46,26 @@ compare_plain_char(char c)
 void
 compare_plain_char_yoda(char c)
 {
-	/* expect+1: warning: nonportable character comparison, op == [230] */
+	/* expect+1: warning: nonportable character comparison '== -129' */
 	if (-129 == c)
 		return;
-	/* expect+1: warning: nonportable character comparison, op == [230] */
+	/* expect+1: warning: nonportable character comparison '== -128' */
 	if (-128 == c)
 		return;
-	/* expect+1: warning: nonportable character comparison, op == [230] */
+	/* expect+1: warning: nonportable character comparison '== -1' */
 	if (-1 == c)
 		return;
 	if (0 == c)
 		return;
 	if (127 == c)
 		return;
-	/* expect+1: warning: nonportable character comparison, op == [230] */
+	/* expect+1: warning: nonportable character comparison '== 128' */
 	if (128 == c)
 		return;
-	/* expect+1: warning: nonportable character comparison, op == [230] */
+	/* expect+1: warning: nonportable character comparison '== 255' */
 	if (255 == c)
 		return;
-	/* expect+1: warning: nonportable character comparison, op == [230] */
+	/* expect+1: warning: nonportable character comparison '== 256' */
 	if (256 == c)
 		return;
 }
@@ -74,10 +74,10 @@ void
 compare_lt(char c)
 {
 
-	/* expect+1: warning: nonportable character comparison, op > [230] */
+	/* expect+1: warning: nonportable character comparison '> -2' [230] */
 	if (c > -2)
 		return;
-	/* expect+1: warning: nonportable character comparison, op >= [230] */
+	/* expect+1: warning: nonportable character comparison '>= -1' [230] */
 	if (c >= -1)
 		return;
 
@@ -85,7 +85,7 @@ compare_lt(char c)
 	 * XXX: The following two comparisons have the same effect, yet lint
 	 * only warns about one of them.
 	 */
-	/* expect+1: warning: nonportable character comparison, op > [230] */
+	/* expect+1: warning: nonportable character comparison '> -1' [230] */
 	if (c > -1)
 		return;
 	/*
@@ -105,14 +105,14 @@ compare_lt(char c)
 	 */
 	if (c > 127)
 		return;
-	/* expect+1: warning: nonportable character comparison, op >= [230] */
+	/* expect+1: warning: nonportable character comparison '>= 128' [230] */
 	if (c >= 128)
 		return;
 
-	/* expect+1: warning: nonportable character comparison, op > [230] */
+	/* expect+1: warning: nonportable character comparison '> 128' [230] */
 	if (c > 128)
 		return;
-	/* expect+1: warning: nonportable character comparison, op >= [230] */
+	/* expect+1: warning: nonportable character comparison '>= 129' [230] */
 	if (c >= 129)
 		return;
 }

Index: src/tests/usr.bin/xlint/lint1/msg_230_uchar.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_230_uchar.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_230_uchar.exp:1.3
--- src/tests/usr.bin/xlint/lint1/msg_230_uchar.exp:1.2	Sat Aug 28 15:25:10 2021
+++ src/tests/usr.bin/xlint/lint1/msg_230_uchar.exp	Thu Dec 16 20:23:40 2021
@@ -1,19 +1,19 @@
-msg_230_uchar.c(23): warning: nonportable character comparison, op == [230]
-msg_230_uchar.c(26): warning: nonportable character comparison, op == [230]
-msg_230_uchar.c(29): warning: nonportable character comparison, op == [230]
-msg_230_uchar.c(36): warning: nonportable character comparison, op == [230]
-msg_230_uchar.c(39): warning: nonportable character comparison, op == [230]
-msg_230_uchar.c(42): warning: nonportable character comparison, op == [230]
-msg_230_uchar.c(50): warning: nonportable character comparison, op == [230]
-msg_230_uchar.c(53): warning: nonportable character comparison, op == [230]
-msg_230_uchar.c(56): warning: nonportable character comparison, op == [230]
-msg_230_uchar.c(63): warning: nonportable character comparison, op == [230]
-msg_230_uchar.c(66): warning: nonportable character comparison, op == [230]
-msg_230_uchar.c(69): warning: nonportable character comparison, op == [230]
-msg_230_uchar.c(78): warning: nonportable character comparison, op > [230]
-msg_230_uchar.c(81): warning: nonportable character comparison, op >= [230]
-msg_230_uchar.c(89): warning: nonportable character comparison, op > [230]
+msg_230_uchar.c(23): warning: nonportable character comparison '== -129' [230]
+msg_230_uchar.c(26): warning: nonportable character comparison '== -128' [230]
+msg_230_uchar.c(29): warning: nonportable character comparison '== -1' [230]
+msg_230_uchar.c(36): warning: nonportable character comparison '== 128' [230]
+msg_230_uchar.c(39): warning: nonportable character comparison '== 255' [230]
+msg_230_uchar.c(42): warning: nonportable character comparison '== 256' [230]
+msg_230_uchar.c(50): warning: nonportable character comparison '== -129' [230]
+msg_230_uchar.c(53): warning: nonportable character comparison '== -128' [230]
+msg_230_uchar.c(56): warning: nonportable character comparison '== -1' [230]
+msg_230_uchar.c(63): warning: nonportable character comparison '== 128' [230]
+msg_230_uchar.c(66): warning: nonportable character comparison '== 255' [230]
+msg_230_uchar.c(69): warning: nonportable character comparison '== 256' [230]
+msg_230_uchar.c(78): warning: nonportable character comparison '> -2' [230]
+msg_230_uchar.c(81): warning: nonportable character comparison '>= -1' [230]
+msg_230_uchar.c(89): warning: nonportable character comparison '> -1' [230]
 msg_230_uchar.c(99): warning: comparison of char with 0, op >= [162]
-msg_230_uchar.c(109): warning: nonportable character comparison, op >= [230]
-msg_230_uchar.c(113): warning: nonportable character comparison, op > [230]
-msg_230_uchar.c(116): warning: nonportable character comparison, op >= [230]
+msg_230_uchar.c(109): warning: nonportable character comparison '>= 128' [230]
+msg_230_uchar.c(113): warning: nonportable character comparison '> 128' [230]
+msg_230_uchar.c(116): warning: nonportable character comparison '>= 129' [230]

Reply via email to