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 tests/lint: force 'expect' annotations
details: https://anonhg.NetBSD.org/src/rev/f392c4d87f5b
branches: trunk
changeset: 953161:f392c4d87f5b
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Feb 28 01:20:54 2021 +0000
description:
tests/lint: force 'expect' annotations
diffstat:
tests/usr.bin/xlint/check-expect.lua | 6 ++++--
tests/usr.bin/xlint/lint1/msg_135.c | 4 ++--
tests/usr.bin/xlint/lint1/msg_153.c | 6 +++---
tests/usr.bin/xlint/lint1/msg_229.c | 6 +++---
4 files changed, 12 insertions(+), 10 deletions(-)
diffs (87 lines):
diff -r cb540883429f -r f392c4d87f5b tests/usr.bin/xlint/check-expect.lua
--- a/tests/usr.bin/xlint/check-expect.lua Sun Feb 28 01:06:57 2021 +0000
+++ b/tests/usr.bin/xlint/check-expect.lua Sun Feb 28 01:20:54 2021 +0000
@@ -1,5 +1,5 @@
#! /usr/bin/lua
--- $NetBSD: check-expect.lua,v 1.5 2021/02/27 17:16:48 rillig Exp $
+-- $NetBSD: check-expect.lua,v 1.6 2021/02/28 01:20:54 rillig Exp $
--[[
@@ -90,9 +90,11 @@
local function check_test(c_fname, errors)
local exp_fname = c_fname:gsub("%.c$", ".exp")
+
local comment_linenos, comments_by_lineno =
load_expect_comments_from_c(c_fname, errors)
- if comment_linenos == nil or #comment_linenos == 0 then return end
+ if comment_linenos == nil then return end
+
local messages = load_actual_messages_from_exp(exp_fname)
if messages == nil then return end
diff -r cb540883429f -r f392c4d87f5b tests/usr.bin/xlint/lint1/msg_135.c
--- a/tests/usr.bin/xlint/lint1/msg_135.c Sun Feb 28 01:06:57 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_135.c Sun Feb 28 01:20:54 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_135.c,v 1.4 2021/02/28 00:40:22 rillig Exp $ */
+/* $NetBSD: msg_135.c,v 1.5 2021/02/28 01:20:54 rillig Exp $ */
# 3 "msg_135.c"
// Test for message: converting '%s' to '%s' may cause alignment problem [135]
@@ -10,7 +10,7 @@
{
unsigned val;
- val = *(const unsigned *)(*pp);
+ val = *(const unsigned *)(*pp); /* expect: 135 */
pp += sizeof(unsigned);
return val;
}
diff -r cb540883429f -r f392c4d87f5b tests/usr.bin/xlint/lint1/msg_153.c
--- a/tests/usr.bin/xlint/lint1/msg_153.c Sun Feb 28 01:06:57 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_153.c Sun Feb 28 01:20:54 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_153.c,v 1.4 2021/02/28 01:06:57 rillig Exp $ */
+/* $NetBSD: msg_153.c,v 1.5 2021/02/28 01:20:54 rillig Exp $ */
# 3 "msg_153.c"
// Test for message: converting '%s' to incompatible '%s' for argument %d [153]
@@ -12,11 +12,11 @@
void
to_function_pointer(int *x)
{
- sink_function_pointer(x);
+ sink_function_pointer(x); /* expect: 153 */
}
void
to_int_pointer(unary_operator op)
{
- sink_int_pointer(op);
+ sink_int_pointer(op); /* expect: 153 */
}
diff -r cb540883429f -r f392c4d87f5b tests/usr.bin/xlint/lint1/msg_229.c
--- a/tests/usr.bin/xlint/lint1/msg_229.c Sun Feb 28 01:06:57 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_229.c Sun Feb 28 01:20:54 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_229.c,v 1.4 2021/02/28 01:06:57 rillig Exp $ */
+/* $NetBSD: msg_229.c,v 1.5 2021/02/28 01:20:54 rillig Exp $ */
# 3 "msg_229.c"
// Test for message: converting '%s' to '%s' is questionable [229]
@@ -8,11 +8,11 @@
int *
to_int_pointer(unary_operator op)
{
- return (int *)op;
+ return (int *)op; /* expect: 229 */
}
unary_operator
to_function_pointer(int *p)
{
- return (unary_operator)p;
+ return (unary_operator)p; /* expect: 229 */
}
Home |
Main Index |
Thread Index |
Old Index