Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src tests/lint: demonstrate hashcode sorting of the lint2 output



details:   https://anonhg.NetBSD.org/src/rev/ec6afdbd172f
branches:  trunk
changeset: 1023184:ec6afdbd172f
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Aug 28 19:45:18 2021 +0000

description:
tests/lint: demonstrate hashcode sorting of the lint2 output

The hashcodes modulo 1009 are:

 48 func7000
637 func0000
646 no_prototype
697 func1000
757 func2000
817 func3000
877 func4000
937 func5000
997 func6000

diffstat:

 distrib/sets/lists/tests/mi                 |   4 +++-
 tests/usr.bin/xlint/lint2/Makefile          |   3 ++-
 tests/usr.bin/xlint/lint2/output_sorted.exp |  27 +++++++++++++++++++++++++++
 tests/usr.bin/xlint/lint2/output_sorted.ln  |  29 +++++++++++++++++++++++++++++
 4 files changed, 61 insertions(+), 2 deletions(-)

diffs (99 lines):

diff -r fbd9c449d730 -r ec6afdbd172f distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Sat Aug 28 19:27:44 2021 +0000
+++ b/distrib/sets/lists/tests/mi       Sat Aug 28 19:45:18 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1117 2021/08/25 22:04:51 rillig Exp $
+# $NetBSD: mi,v 1.1118 2021/08/28 19:45:18 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -7083,6 +7083,8 @@
 ./usr/tests/usr.bin/xlint/lint2/msg_017.ln             tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint2/msg_018.exp            tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint2/msg_018.ln             tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/output_sorted.exp      tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint2/output_sorted.ln       tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint2/read.exp               tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint2/read.ln                        tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint2/read_lp64.exp          tests-usr.bin-tests     compattestfile,atf
diff -r fbd9c449d730 -r ec6afdbd172f tests/usr.bin/xlint/lint2/Makefile
--- a/tests/usr.bin/xlint/lint2/Makefile        Sat Aug 28 19:27:44 2021 +0000
+++ b/tests/usr.bin/xlint/lint2/Makefile        Sat Aug 28 19:45:18 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2021/08/24 21:30:52 rillig Exp $
+# $NetBSD: Makefile,v 1.8 2021/08/28 19:45:18 rillig Exp $
 
 NOMAN=         yes
 
@@ -17,6 +17,7 @@
     010 011 012 013 014 015 016 017 018
 TESTS+=                msg_${msg}
 .endfor
+TESTS+=                output_sorted
 TESTS+=                read
 TESTS+=                read_lp64
 TESTS+=                read_printf
diff -r fbd9c449d730 -r ec6afdbd172f tests/usr.bin/xlint/lint2/output_sorted.exp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint2/output_sorted.exp       Sat Aug 28 19:45:18 2021 +0000
@@ -0,0 +1,27 @@
+func7000 used( output_sorted.c(10) ), but not defined
+func7000, arg 1 used inconsistently    output_sorted.c(10)[int]  ::  output_sorted.c(11)[pointer to const char]
+func7000, arg 2 used inconsistently    output_sorted.c(10)[pointer to const char]  ::  output_sorted.c(11)[double]
+func0000 used( output_sorted.c(10) ), but not defined
+func0000, arg 1 used inconsistently    output_sorted.c(10)[int]  ::  output_sorted.c(11)[pointer to const char]
+func0000, arg 2 used inconsistently    output_sorted.c(10)[pointer to const char]  ::  output_sorted.c(11)[double]
+no_prototype used( output_sorted.c(10) ), but not defined
+no_prototype, arg 1 used inconsistently        output_sorted.c(10)[int]  ::  output_sorted.c(11)[pointer to const char]
+no_prototype, arg 2 used inconsistently        output_sorted.c(10)[pointer to const char]  ::  output_sorted.c(11)[double]
+func1000 used( output_sorted.c(10) ), but not defined
+func1000, arg 1 used inconsistently    output_sorted.c(10)[int]  ::  output_sorted.c(11)[pointer to const char]
+func1000, arg 2 used inconsistently    output_sorted.c(10)[pointer to const char]  ::  output_sorted.c(11)[double]
+func2000 used( output_sorted.c(10) ), but not defined
+func2000, arg 1 used inconsistently    output_sorted.c(10)[int]  ::  output_sorted.c(11)[pointer to const char]
+func2000, arg 2 used inconsistently    output_sorted.c(10)[pointer to const char]  ::  output_sorted.c(11)[double]
+func3000 used( output_sorted.c(10) ), but not defined
+func3000, arg 1 used inconsistently    output_sorted.c(10)[int]  ::  output_sorted.c(11)[pointer to const char]
+func3000, arg 2 used inconsistently    output_sorted.c(10)[pointer to const char]  ::  output_sorted.c(11)[double]
+func4000 used( output_sorted.c(10) ), but not defined
+func4000, arg 1 used inconsistently    output_sorted.c(10)[int]  ::  output_sorted.c(11)[pointer to const char]
+func4000, arg 2 used inconsistently    output_sorted.c(10)[pointer to const char]  ::  output_sorted.c(11)[double]
+func5000 used( output_sorted.c(10) ), but not defined
+func5000, arg 1 used inconsistently    output_sorted.c(10)[int]  ::  output_sorted.c(11)[pointer to const char]
+func5000, arg 2 used inconsistently    output_sorted.c(10)[pointer to const char]  ::  output_sorted.c(11)[double]
+func6000 used( output_sorted.c(10) ), but not defined
+func6000, arg 1 used inconsistently    output_sorted.c(10)[int]  ::  output_sorted.c(11)[pointer to const char]
+func6000, arg 2 used inconsistently    output_sorted.c(10)[pointer to const char]  ::  output_sorted.c(11)[double]
diff -r fbd9c449d730 -r ec6afdbd172f tests/usr.bin/xlint/lint2/output_sorted.ln
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint2/output_sorted.ln        Sat Aug 28 19:45:18 2021 +0000
@@ -0,0 +1,29 @@
+# $NetBSD: output_sorted.ln,v 1.1 2021/08/28 19:45:18 rillig Exp $
+#
+# Test whether the output is sorted by symbol name.
+# As of 2021-08-28, the output is sorted by hashcode, which looks random.
+
+0 s output_sorted.c
+S output_sorted.c
+
+10 c 0.10 d    12no_prototype          f2 I PcC V
+11 c 0.11 d    12no_prototype          f2 PcC D V
+
+# Function calls with different names and incompatible argument types.
+# The function names are sorted by their Gray code.
+10 c 0.10 d    8func0000               f2 I PcC V
+11 c 0.11 d    8func0000               f2 PcC D V
+10 c 0.10 d    8func1000               f2 I PcC V
+11 c 0.11 d    8func1000               f2 PcC D V
+10 c 0.10 d    8func3000               f2 I PcC V
+11 c 0.11 d    8func3000               f2 PcC D V
+10 c 0.10 d    8func2000               f2 I PcC V
+11 c 0.11 d    8func2000               f2 PcC D V
+10 c 0.10 d    8func6000               f2 I PcC V
+11 c 0.11 d    8func6000               f2 PcC D V
+10 c 0.10 d    8func7000               f2 I PcC V
+11 c 0.11 d    8func7000               f2 PcC D V
+10 c 0.10 d    8func5000               f2 I PcC V
+11 c 0.11 d    8func5000               f2 PcC D V
+10 c 0.10 d    8func4000               f2 I PcC V
+11 c 0.11 d    8func4000               f2 PcC D V



Home | Main Index | Thread Index | Old Index