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 messages...



details:   https://anonhg.NetBSD.org/src/rev/50c9848d6060
branches:  trunk
changeset: 1022914:50c9848d6060
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Aug 14 14:25:51 2021 +0000

description:
tests/lint: add tests for messages 8, 9 and 10

diffstat:

 tests/usr.bin/xlint/lint2/msg_008.exp |   1 +
 tests/usr.bin/xlint/lint2/msg_008.ln  |  14 ++++++++++++--
 tests/usr.bin/xlint/lint2/msg_009.exp |   1 +
 tests/usr.bin/xlint/lint2/msg_009.ln  |  14 ++++++++++++--
 tests/usr.bin/xlint/lint2/msg_010.exp |   1 +
 tests/usr.bin/xlint/lint2/msg_010.ln  |  15 +++++++++++++--
 6 files changed, 40 insertions(+), 6 deletions(-)

diffs (82 lines):

diff -r 08619c3bf0dc -r 50c9848d6060 tests/usr.bin/xlint/lint2/msg_008.exp
--- a/tests/usr.bin/xlint/lint2/msg_008.exp     Sat Aug 14 13:39:43 2021 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_008.exp     Sat Aug 14 14:25:51 2021 +0000
@@ -0,0 +1,1 @@
+func returns value which is always ignored
diff -r 08619c3bf0dc -r 50c9848d6060 tests/usr.bin/xlint/lint2/msg_008.ln
--- a/tests/usr.bin/xlint/lint2/msg_008.ln      Sat Aug 14 13:39:43 2021 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_008.ln      Sat Aug 14 14:25:51 2021 +0000
@@ -1,6 +1,16 @@
-# $NetBSD: msg_008.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
+# $NetBSD: msg_008.ln,v 1.2 2021/08/14 14:25:51 rillig Exp $
 #
 # Test data for message 8 of lint2:
 #      %s returns value which is always ignored
 #
-# TODO: add actual test data
+
+0smsg_008.c
+Smsg_008.c
+
+# 100: bool func(void) { return true }
+100 d 0.100 drs 4func F0 B
+
+# 110: func();
+110 c 0.110 i 4func f0 B
+# 111: func();
+111 c 0.111 i 4func f0 B
diff -r 08619c3bf0dc -r 50c9848d6060 tests/usr.bin/xlint/lint2/msg_009.exp
--- a/tests/usr.bin/xlint/lint2/msg_009.exp     Sat Aug 14 13:39:43 2021 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_009.exp     Sat Aug 14 14:25:51 2021 +0000
@@ -0,0 +1,1 @@
+func returns value which is sometimes ignored
diff -r 08619c3bf0dc -r 50c9848d6060 tests/usr.bin/xlint/lint2/msg_009.ln
--- a/tests/usr.bin/xlint/lint2/msg_009.ln      Sat Aug 14 13:39:43 2021 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_009.ln      Sat Aug 14 14:25:51 2021 +0000
@@ -1,6 +1,16 @@
-# $NetBSD: msg_009.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
+# $NetBSD: msg_009.ln,v 1.2 2021/08/14 14:25:51 rillig Exp $
 #
 # Test data for message 9 of lint2:
 #      %s returns value which is sometimes ignored
 #
-# TODO: add actual test data
+
+0smsg_009.c
+Smsg_009.c
+
+# 100: bool func(void) { return true }
+100 d 0.100 drs 4func F0 B
+
+# 110: var = func();
+110 c 0.110 u 4func f0 B
+# 111: func();
+111 c 0.111 i 4func f0 B
diff -r 08619c3bf0dc -r 50c9848d6060 tests/usr.bin/xlint/lint2/msg_010.exp
--- a/tests/usr.bin/xlint/lint2/msg_010.exp     Sat Aug 14 13:39:43 2021 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_010.exp     Sat Aug 14 14:25:51 2021 +0000
@@ -0,0 +1,1 @@
+func value is used( msg_010.c?(30) ), but none returned
diff -r 08619c3bf0dc -r 50c9848d6060 tests/usr.bin/xlint/lint2/msg_010.ln
--- a/tests/usr.bin/xlint/lint2/msg_010.ln      Sat Aug 14 13:39:43 2021 +0000
+++ b/tests/usr.bin/xlint/lint2/msg_010.ln      Sat Aug 14 14:25:51 2021 +0000
@@ -1,6 +1,17 @@
-# $NetBSD: msg_010.ln,v 1.1 2021/08/05 22:36:08 rillig Exp $
+# $NetBSD: msg_010.ln,v 1.2 2021/08/14 14:25:51 rillig Exp $
 #
 # Test data for message 10 of lint2:
 #      %s value is used( %s ), but none returned
 #
-# TODO: add actual test data
+
+0 s msg_010.c
+S msg_010.c
+1 s msg_010_use.c
+
+# msg_010.c:10: func() {}
+10 d 0.10 d o 4func f0I
+
+# msg_010_use.c:20: func();
+20 d 1.20 e 4func F I
+# msg_010_use.c:30: use() { return func(); }
+30 c 1.30 u 4func f 0 I



Home | Main Index | Thread Index | Old Index