Source-Changes-HG archive

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

[src/trunk]: src/tests/usr.bin/indent tests/indent: migrate test for offsetof...



details:   https://anonhg.NetBSD.org/src/rev/7ff24d224b84
branches:  trunk
changeset: 1024435:7ff24d224b84
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Oct 23 20:17:08 2021 +0000

description:
tests/indent: migrate test for offsetof to t_options

diffstat:

 distrib/sets/lists/tests/mi            |   7 ++++---
 tests/usr.bin/indent/Makefile          |   5 ++---
 tests/usr.bin/indent/fmt_expr.c        |  24 ++++++++++++++++++++++++
 tests/usr.bin/indent/offsetof.0        |   6 ------
 tests/usr.bin/indent/offsetof.0.stdout |   8 --------
 5 files changed, 30 insertions(+), 20 deletions(-)

diffs (102 lines):

diff -r db3f86c3aec0 -r 7ff24d224b84 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Sat Oct 23 20:07:03 2021 +0000
+++ b/distrib/sets/lists/tests/mi       Sat Oct 23 20:17:08 2021 +0000
@@ -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
diff -r db3f86c3aec0 -r 7ff24d224b84 tests/usr.bin/indent/Makefile
--- a/tests/usr.bin/indent/Makefile     Sat Oct 23 20:07:03 2021 +0000
+++ b/tests/usr.bin/indent/Makefile     Sat Oct 23 20:17:08 2021 +0000
@@ -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 @@
 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
diff -r db3f86c3aec0 -r 7ff24d224b84 tests/usr.bin/indent/fmt_expr.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/indent/fmt_expr.c   Sat Oct 23 20:17:08 2021 +0000
@@ -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
diff -r db3f86c3aec0 -r 7ff24d224b84 tests/usr.bin/indent/offsetof.0
--- a/tests/usr.bin/indent/offsetof.0   Sat Oct 23 20:07:03 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-/*     $NetBSD: offsetof.0,v 1.1 2019/04/04 15:27:35 kamil Exp $       */
-/* $FreeBSD: head/usr.bin/indent/tests/offsetof.0 313544 2017-02-10 09:31:39Z pstef $ */
-/* See r303718 */
-void t(void) {
-       int n = malloc(offsetof(struct s, f) + 1);
-}
diff -r db3f86c3aec0 -r 7ff24d224b84 tests/usr.bin/indent/offsetof.0.stdout
--- a/tests/usr.bin/indent/offsetof.0.stdout    Sat Oct 23 20:07:03 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-/*     $NetBSD: offsetof.0.stdout,v 1.1 2019/04/04 15:27:35 kamil Exp $        */
-/* $FreeBSD: head/usr.bin/indent/tests/offsetof.0.stdout 321381 2017-07-23 14:04:45Z pstef $ */
-/* See r303718 */
-void
-t(void)
-{
-       int             n = malloc(offsetof(struct s, f) + 1);
-}



Home | Main Index | Thread Index | Old Index