Module Name:    src
Committed By:   rillig
Date:           Sat Aug 14 14:25:51 UTC 2021

Modified Files:
        src/tests/usr.bin/xlint/lint2: msg_008.exp msg_008.ln msg_009.exp
            msg_009.ln msg_010.exp msg_010.ln

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


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint2/msg_008.exp \
    src/tests/usr.bin/xlint/lint2/msg_008.ln \
    src/tests/usr.bin/xlint/lint2/msg_009.exp \
    src/tests/usr.bin/xlint/lint2/msg_009.ln \
    src/tests/usr.bin/xlint/lint2/msg_010.exp \
    src/tests/usr.bin/xlint/lint2/msg_010.ln

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/lint2/msg_008.exp
diff -u src/tests/usr.bin/xlint/lint2/msg_008.exp:1.1 src/tests/usr.bin/xlint/lint2/msg_008.exp:1.2
--- src/tests/usr.bin/xlint/lint2/msg_008.exp:1.1	Thu Aug  5 22:36:08 2021
+++ src/tests/usr.bin/xlint/lint2/msg_008.exp	Sat Aug 14 14:25:51 2021
@@ -0,0 +1 @@
+func returns value which is always ignored
Index: src/tests/usr.bin/xlint/lint2/msg_008.ln
diff -u src/tests/usr.bin/xlint/lint2/msg_008.ln:1.1 src/tests/usr.bin/xlint/lint2/msg_008.ln:1.2
--- src/tests/usr.bin/xlint/lint2/msg_008.ln:1.1	Thu Aug  5 22:36:08 2021
+++ src/tests/usr.bin/xlint/lint2/msg_008.ln	Sat Aug 14 14:25:51 2021
@@ -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
Index: src/tests/usr.bin/xlint/lint2/msg_009.exp
diff -u src/tests/usr.bin/xlint/lint2/msg_009.exp:1.1 src/tests/usr.bin/xlint/lint2/msg_009.exp:1.2
--- src/tests/usr.bin/xlint/lint2/msg_009.exp:1.1	Thu Aug  5 22:36:08 2021
+++ src/tests/usr.bin/xlint/lint2/msg_009.exp	Sat Aug 14 14:25:51 2021
@@ -0,0 +1 @@
+func returns value which is sometimes ignored
Index: src/tests/usr.bin/xlint/lint2/msg_009.ln
diff -u src/tests/usr.bin/xlint/lint2/msg_009.ln:1.1 src/tests/usr.bin/xlint/lint2/msg_009.ln:1.2
--- src/tests/usr.bin/xlint/lint2/msg_009.ln:1.1	Thu Aug  5 22:36:08 2021
+++ src/tests/usr.bin/xlint/lint2/msg_009.ln	Sat Aug 14 14:25:51 2021
@@ -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
Index: src/tests/usr.bin/xlint/lint2/msg_010.exp
diff -u src/tests/usr.bin/xlint/lint2/msg_010.exp:1.1 src/tests/usr.bin/xlint/lint2/msg_010.exp:1.2
--- src/tests/usr.bin/xlint/lint2/msg_010.exp:1.1	Thu Aug  5 22:36:08 2021
+++ src/tests/usr.bin/xlint/lint2/msg_010.exp	Sat Aug 14 14:25:51 2021
@@ -0,0 +1 @@
+func value is used( msg_010.c?(30) ), but none returned
Index: src/tests/usr.bin/xlint/lint2/msg_010.ln
diff -u src/tests/usr.bin/xlint/lint2/msg_010.ln:1.1 src/tests/usr.bin/xlint/lint2/msg_010.ln:1.2
--- src/tests/usr.bin/xlint/lint2/msg_010.ln:1.1	Thu Aug  5 22:36:08 2021
+++ src/tests/usr.bin/xlint/lint2/msg_010.ln	Sat Aug 14 14:25:51 2021
@@ -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

Reply via email to