Module Name:    src
Committed By:   rillig
Date:           Sat Oct 23 20:17:08 UTC 2021

Modified Files:
        src/distrib/sets/lists/tests: mi
        src/tests/usr.bin/indent: Makefile
Added Files:
        src/tests/usr.bin/indent: fmt_expr.c
Removed Files:
        src/tests/usr.bin/indent: offsetof.0 offsetof.0.stdout

Log Message:
tests/indent: migrate test for offsetof to t_options


To generate a diff of this commit:
cvs rdiff -u -r1.1157 -r1.1158 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.29 -r1.30 src/tests/usr.bin/indent/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/indent/fmt_expr.c
cvs rdiff -u -r1.1 -r0 src/tests/usr.bin/indent/offsetof.0 \
    src/tests/usr.bin/indent/offsetof.0.stdout

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1157 src/distrib/sets/lists/tests/mi:1.1158
--- src/distrib/sets/lists/tests/mi:1.1157	Sat Oct 23 20:07:03 2021
+++ src/distrib/sets/lists/tests/mi	Sat Oct 23 20:17:08 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1157 2021/10/23 20:07:03 rillig Exp $
+# $NetBSD: mi,v 1.1158 2021/10/23 20:17:08 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4757,6 +4757,7 @@
 ./usr/tests/usr.bin/indent/fmt_block.c					tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/indent/fmt_decl.c					tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/indent/fmt_else_comment.c				tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/indent/fmt_expr.c					tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/indent/indent_off_on.c				tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/indent/indent_variables.0				tests-obsolete		obsolete,atf
 ./usr/tests/usr.bin/indent/indent_variables.0.pro			tests-obsolete		obsolete,atf
@@ -4786,8 +4787,8 @@
 ./usr/tests/usr.bin/indent/ncs.0					tests-obsolete		obsolete,atf
 ./usr/tests/usr.bin/indent/ncs.0.pro					tests-obsolete		obsolete,atf
 ./usr/tests/usr.bin/indent/ncs.0.stdout					tests-obsolete		obsolete,atf
-./usr/tests/usr.bin/indent/offsetof.0					tests-usr.bin-tests	compattestfile,atf
-./usr/tests/usr.bin/indent/offsetof.0.stdout				tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/indent/offsetof.0					tests-obsolete		obsolete,atf
+./usr/tests/usr.bin/indent/offsetof.0.stdout				tests-obsolete		obsolete,atf
 ./usr/tests/usr.bin/indent/opt--version.0				tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/indent/opt--version.0.pro				tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/indent/opt--version.0.stdout			tests-usr.bin-tests	compattestfile,atf

Index: src/tests/usr.bin/indent/Makefile
diff -u src/tests/usr.bin/indent/Makefile:1.29 src/tests/usr.bin/indent/Makefile:1.30
--- src/tests/usr.bin/indent/Makefile:1.29	Sat Oct 23 20:07:03 2021
+++ src/tests/usr.bin/indent/Makefile	Sat Oct 23 20:17:08 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.29 2021/10/23 20:07:03 rillig Exp $
+#	$NetBSD: Makefile,v 1.30 2021/10/23 20:17:08 rillig Exp $
 
 .include <bsd.own.mk>
 
@@ -12,13 +12,12 @@ FILESDIR=	${TESTSDIR}
 FILES=		fmt_block.c
 FILES+=		fmt_decl.c
 FILES+=		fmt_else_comment.c
+FILES+=		fmt_expr.c
 FILES+=		indent_off_on.c
 FILES+=		label.c
 FILES+=		lex_ident.c
 FILES+=		lex_char.c
 FILES+=		lex_string.c
-FILES+=		offsetof.0
-FILES+=		offsetof.0.stdout
 FILES+=		opt--version.0
 FILES+=		opt--version.0.pro
 FILES+=		opt--version.0.stdout

Added files:

Index: src/tests/usr.bin/indent/fmt_expr.c
diff -u /dev/null src/tests/usr.bin/indent/fmt_expr.c:1.1
--- /dev/null	Sat Oct 23 20:17:08 2021
+++ src/tests/usr.bin/indent/fmt_expr.c	Sat Oct 23 20:17:08 2021
@@ -0,0 +1,24 @@
+/* $NetBSD: fmt_expr.c,v 1.1 2021/10/23 20:17:08 rillig Exp $ */
+/* $FreeBSD$ */
+
+/*
+ * Tests for all kinds of expressions that are not directly related to unary
+ * or binary operators.
+ *
+ * See also: token_binary_op, token_unary_op.
+ */
+
+/* See FreeBSD r303718. */
+#indent input
+void t(void) {
+    int n = malloc(offsetof(struct s, f) + 1);
+}
+#indent end
+
+#indent run
+void
+t(void)
+{
+	int		n = malloc(offsetof(struct s, f) + 1);
+}
+#indent end

Reply via email to