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 f_decls to using ...



details:   https://anonhg.NetBSD.org/src/rev/361ccf90cada
branches:  trunk
changeset: 1024433:361ccf90cada
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Oct 23 20:01:14 2021 +0000

description:
tests/indent: migrate f_decls to using t_options, add more tests

diffstat:

 distrib/sets/lists/tests/mi           |    6 +-
 tests/usr.bin/indent/Makefile         |    4 +-
 tests/usr.bin/indent/f_decls.0        |   30 -------
 tests/usr.bin/indent/f_decls.0.stdout |   33 --------
 tests/usr.bin/indent/fmt_decl.c       |  134 ++++++++++++++++++++++++++++-----
 5 files changed, 118 insertions(+), 89 deletions(-)

diffs (289 lines):

diff -r e0921b9fe5a9 -r 361ccf90cada distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Sat Oct 23 18:46:26 2021 +0000
+++ b/distrib/sets/lists/tests/mi       Sat Oct 23 20:01:14 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1155 2021/10/23 18:46:26 thorpej Exp $
+# $NetBSD: mi,v 1.1156 2021/10/23 20:01:14 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4750,8 +4750,8 @@
 ./usr/tests/usr.bin/indent/elsecomment.0                               tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/elsecomment.0.pro                           tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/elsecomment.0.stdout                                tests-obsolete          obsolete,atf
-./usr/tests/usr.bin/indent/f_decls.0                                   tests-usr.bin-tests     compattestfile,atf
-./usr/tests/usr.bin/indent/f_decls.0.stdout                            tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/indent/f_decls.0                                   tests-obsolete          obsolete,atf
+./usr/tests/usr.bin/indent/f_decls.0.stdout                            tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/float.0                                     tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/float.0.stdout                              tests-obsolete          obsolete,atf
 ./usr/tests/usr.bin/indent/fmt_block.c                                 tests-usr.bin-tests     compattestfile,atf
diff -r e0921b9fe5a9 -r 361ccf90cada tests/usr.bin/indent/Makefile
--- a/tests/usr.bin/indent/Makefile     Sat Oct 23 18:46:26 2021 +0000
+++ b/tests/usr.bin/indent/Makefile     Sat Oct 23 20:01:14 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.27 2021/10/22 20:54:36 rillig Exp $
+#      $NetBSD: Makefile,v 1.28 2021/10/23 20:01:14 rillig Exp $
 
 .include <bsd.own.mk>
 
@@ -12,8 +12,6 @@
 FILES=         fmt_block.c
 FILES+=                fmt_decl.c
 FILES+=                fmt_else_comment.c
-FILES+=                f_decls.0
-FILES+=                f_decls.0.stdout
 FILES+=                indent_off_on.c
 FILES+=                label.c
 FILES+=                lex_ident.c
diff -r e0921b9fe5a9 -r 361ccf90cada tests/usr.bin/indent/f_decls.0
--- a/tests/usr.bin/indent/f_decls.0    Sat Oct 23 18:46:26 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*     $NetBSD: f_decls.0,v 1.1 2019/04/04 15:27:35 kamil Exp $        */
-/* $FreeBSD: head/usr.bin/indent/tests/f_decls.0 334566 2018-06-03 16:42:58Z pstef $ */
-
-char * x(void)
-{
-    type identifier;
-    type *pointer;
-    unused * value;
-    (void)unused * value;
-
-    dmax = (double)3 * 10.0;
-    dmin = (double)dmax * 10.0;
-    davg = (double)dmax * dmin;
-
-    return NULL;
-}
-
-int *
-y(void) {
-
-}
-
-int
-z(void) {
-
-}
-
-int x;
-int *y;
-int * * * * z;
diff -r e0921b9fe5a9 -r 361ccf90cada tests/usr.bin/indent/f_decls.0.stdout
--- a/tests/usr.bin/indent/f_decls.0.stdout     Sat Oct 23 18:46:26 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*     $NetBSD: f_decls.0.stdout,v 1.1 2019/04/04 15:27:35 kamil Exp $ */
-/* $FreeBSD: head/usr.bin/indent/tests/f_decls.0.stdout 334566 2018-06-03 16:42:58Z pstef $ */
-
-char *
-x(void)
-{
-       type            identifier;
-       type           *pointer;
-       unused         *value;
-       (void)unused * value;
-
-       dmax = (double)3 * 10.0;
-       dmin = (double)dmax * 10.0;
-       davg = (double)dmax * dmin;
-
-       return NULL;
-}
-
-int *
-y(void)
-{
-
-}
-
-int
-z(void)
-{
-
-}
-
-int            x;
-int           *y;
-int        ****z;
diff -r e0921b9fe5a9 -r 361ccf90cada tests/usr.bin/indent/fmt_decl.c
--- a/tests/usr.bin/indent/fmt_decl.c   Sat Oct 23 18:46:26 2021 +0000
+++ b/tests/usr.bin/indent/fmt_decl.c   Sat Oct 23 20:01:14 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fmt_decl.c,v 1.1 2021/10/22 19:27:53 rillig Exp $      */
+/*     $NetBSD: fmt_decl.c,v 1.2 2021/10/23 20:01:14 rillig Exp $      */
 /* $FreeBSD: head/usr.bin/indent/tests/declarations.0 334478 2018-06-01 09:41:15Z pstef $ */
 
 /* See FreeBSD r303570 */
@@ -147,7 +147,6 @@
 void
 print_error(const char *fmt,...)
 {
-
 }
 #indent end
 
@@ -157,7 +156,39 @@
 void
 print_error(const char *fmt, ...)
 {
+}
+#indent end
 
+
+#indent input
+static _attribute_printf(1, 2)
+void
+print_error(const char *fmt,...)
+{
+}
+#indent end
+
+#indent run
+static _attribute_printf(1, 2)
+void
+print_error(const char *fmt, ...)
+{
+}
+#indent end
+
+
+#indent input
+static void _attribute_printf(1, 2)
+print_error(const char *fmt,...)
+{
+}
+#indent end
+
+#indent run
+static void
+_attribute_printf(1, 2)
+print_error(const char *fmt, ...)
+{
 }
 #indent end
 
@@ -177,10 +208,10 @@
 
 #indent input
 static int
-do_execve(td, args, mac_p)
-       struct thread *td;
-       struct image_args *args;
-       struct mac *mac_p;
+old_style_definition(a, b, c)
+       struct thread *a;
+       int b;
+       double ***c;
 {
 
 }
@@ -188,26 +219,16 @@
 
 #indent run
 static int
-do_execve(td, args, mac_p)
-       struct thread  *td;
-       struct image_args *args;
-       struct mac     *mac_p;
+old_style_definition(a, b, c)
+       struct thread  *a;
+       int             b;
+       double       ***c;
 {
 
 }
 #indent end
 
 
-#indent input
-int
-my_printf(const char *fmt, ...)
-{
-}
-#indent end
-
-#indent run-equals-input
-
-
 /*
  * Demonstrate how variable declarations are broken into several lines when
  * the line length limit is set quite low.
@@ -260,3 +281,76 @@
 struct s01234567890123 a,
                 b;
 #indent end
+
+
+#indent input
+char * x(void)
+{
+    type identifier;
+    type *pointer;
+    unused * value;
+    (void)unused * value;
+
+    dmax = (double)3 * 10.0;
+    dmin = (double)dmax * 10.0;
+    davg = (double)dmax * dmin;
+
+    return NULL;
+}
+#indent end
+
+#indent run
+char *
+x(void)
+{
+       type            identifier;
+       type           *pointer;
+       unused         *value;
+       (void)unused * value;
+
+       dmax = (double)3 * 10.0;
+       dmin = (double)dmax * 10.0;
+       davg = (double)dmax * dmin;
+
+       return NULL;
+}
+#indent end
+
+#indent input
+int *
+y(void) {
+
+}
+
+int
+z(void) {
+
+}
+#indent end
+
+#indent run
+int *
+y(void)
+{
+
+}
+
+int
+z(void)
+{
+
+}
+#indent end
+
+
+#indent input
+int x;
+int *y;
+int * * * * z;
+#indent end
+
+#indent run
+int            x;
+int           *y;
+int        ****z;
+#indent end



Home | Main Index | Thread Index | Old Index