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/lint2 tests/lint: add tests for declared...



details:   https://anonhg.NetBSD.org/src/rev/3f369f497ece
branches:  trunk
changeset: 985055:3f369f497ece
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Aug 06 16:21:00 2021 +0000

description:
tests/lint: add tests for declared but unused variables

diffstat:

 tests/usr.bin/xlint/lint2/msg_001.exp |   2 ++
 tests/usr.bin/xlint/lint2/msg_001.ln  |   9 +++++++--
 tests/usr.bin/xlint/lint2/msg_002.exp |   2 ++
 tests/usr.bin/xlint/lint2/msg_002.ln  |  12 ++++++++++--
 4 files changed, 21 insertions(+), 4 deletions(-)

diffs (49 lines):

diff -r e97aa3fc0c1e -r 3f369f497ece tests/usr.bin/xlint/lint2/msg_001.exp
--- a/tests/usr.bin/xlint/lint2/msg_001.exp     Fri Aug 06 09:01:36 2021 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_001.exp     Fri Aug 06 16:21:00 2021 +0000
@@ -0,0 +1,2 @@
+defined_not_used defined( msg_000.c(2) ), but never used
+used_not_defined used( msg_000.c(3) ), but not defined
diff -r e97aa3fc0c1e -r 3f369f497ece tests/usr.bin/xlint/lint2/msg_001.ln
--- a/tests/usr.bin/xlint/lint2/msg_001.ln      Fri Aug 06 09:01:36 2021 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_001.ln      Fri Aug 06 16:21:00 2021 +0000
@@ -1,6 +1,11 @@
-# $NetBSD: msg_001.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
+# $NetBSD: msg_001.ln,v 1.2 2021/08/06 16:21:00 rillig Exp $
 #
 # Test data for message 1 of lint2:
 #      %s defined( %s ), but never used
 #
-# TODO: add actual test data
+
+0smsg_000.c
+Smsg_000.c
+
+3c0.3p1i16used_not_definedf2IDI
+2d0.2do16defined_not_usedf0I
diff -r e97aa3fc0c1e -r 3f369f497ece tests/usr.bin/xlint/lint2/msg_002.exp
--- a/tests/usr.bin/xlint/lint2/msg_002.exp     Fri Aug 06 09:01:36 2021 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_002.exp     Fri Aug 06 16:21:00 2021 +0000
@@ -0,0 +1,2 @@
+defined defined( msg_002.c(3) ), but never used
+only_declared declared( msg_002.c(2) ), but never used or defined
diff -r e97aa3fc0c1e -r 3f369f497ece tests/usr.bin/xlint/lint2/msg_002.ln
--- a/tests/usr.bin/xlint/lint2/msg_002.ln      Fri Aug 06 09:01:36 2021 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_002.ln      Fri Aug 06 16:21:00 2021 +0000
@@ -1,6 +1,14 @@
-# $NetBSD: msg_002.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
+# $NetBSD: msg_002.ln,v 1.2 2021/08/06 16:21:00 rillig Exp $
 #
 # Test data for message 2 of lint2:
 #      %s declared( %s ), but never used or defined
 #
-# TODO: add actual test data
+
+0smsg_002.c
+Smsg_002.c
+
+# extern int only_declared;
+2d0.2e13only_declaredI
+
+# int defined;
+3d0.3t7definedI



Home | Main Index | Thread Index | Old Index