Module Name: src
Committed By: rillig
Date: Fri Oct 22 19:46:41 UTC 2021
Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/usr.bin/indent: Makefile opt_bad.c
token_keyword_struct_union_enum.c token_string_prefix.c
Removed Files:
src/tests/usr.bin/indent: parens.0 parens.0.pro parens.0.stdout
struct.0 struct.0.stdout surplusbad.0 surplusbad.0.pro
surplusbad.0.stdout wchar.0 wchar.0.stdout
Log Message:
tests/indent: migrate tests for parentheses, struct, #if, wide char
To generate a diff of this commit:
cvs rdiff -u -r1.1149 -r1.1150 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.25 -r1.26 src/tests/usr.bin/indent/Makefile
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/indent/opt_bad.c
cvs rdiff -u -r1.2 -r0 src/tests/usr.bin/indent/parens.0 \
src/tests/usr.bin/indent/parens.0.stdout
cvs rdiff -u -r1.1 -r0 src/tests/usr.bin/indent/parens.0.pro \
src/tests/usr.bin/indent/struct.0 \
src/tests/usr.bin/indent/struct.0.stdout \
src/tests/usr.bin/indent/surplusbad.0 \
src/tests/usr.bin/indent/surplusbad.0.pro \
src/tests/usr.bin/indent/surplusbad.0.stdout \
src/tests/usr.bin/indent/wchar.0 src/tests/usr.bin/indent/wchar.0.stdout
cvs rdiff -u -r1.1 -r1.2 \
src/tests/usr.bin/indent/token_keyword_struct_union_enum.c \
src/tests/usr.bin/indent/token_string_prefix.c
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.1149 src/distrib/sets/lists/tests/mi:1.1150
--- src/distrib/sets/lists/tests/mi:1.1149 Fri Oct 22 19:27:53 2021
+++ src/distrib/sets/lists/tests/mi Fri Oct 22 19:46:41 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1149 2021/10/22 19:27:53 rillig Exp $
+# $NetBSD: mi,v 1.1150 2021/10/22 19:46:41 rillig Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -5023,9 +5023,9 @@
./usr/tests/usr.bin/indent/opt_sob.c tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/indent/opt_ut.c tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/indent/opt_v.c tests-usr.bin-tests compattestfile,atf
-./usr/tests/usr.bin/indent/parens.0 tests-usr.bin-tests compattestfile,atf
-./usr/tests/usr.bin/indent/parens.0.pro tests-usr.bin-tests compattestfile,atf
-./usr/tests/usr.bin/indent/parens.0.stdout tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/indent/parens.0 tests-obsolete obsolete,atf
+./usr/tests/usr.bin/indent/parens.0.pro tests-obsolete obsolete,atf
+./usr/tests/usr.bin/indent/parens.0.stdout tests-obsolete obsolete,atf
./usr/tests/usr.bin/indent/pcs.0 tests-obsolete obsolete,atf
./usr/tests/usr.bin/indent/pcs.0.pro tests-obsolete obsolete,atf
./usr/tests/usr.bin/indent/pcs.0.stdout tests-obsolete obsolete,atf
@@ -5033,11 +5033,11 @@
./usr/tests/usr.bin/indent/ps_ind_level.0.pro tests-obsolete obsolete,atf
./usr/tests/usr.bin/indent/ps_ind_level.0.stdout tests-obsolete obsolete,atf
./usr/tests/usr.bin/indent/ps_ind_level.c tests-usr.bin-tests compattestfile,atf
-./usr/tests/usr.bin/indent/struct.0 tests-usr.bin-tests compattestfile,atf
-./usr/tests/usr.bin/indent/struct.0.stdout tests-usr.bin-tests compattestfile,atf
-./usr/tests/usr.bin/indent/surplusbad.0 tests-usr.bin-tests compattestfile,atf
-./usr/tests/usr.bin/indent/surplusbad.0.pro tests-usr.bin-tests compattestfile,atf
-./usr/tests/usr.bin/indent/surplusbad.0.stdout tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/indent/struct.0 tests-obsolete obsolete,atf
+./usr/tests/usr.bin/indent/struct.0.stdout tests-obsolete obsolete,atf
+./usr/tests/usr.bin/indent/surplusbad.0 tests-obsolete obsolete,atf
+./usr/tests/usr.bin/indent/surplusbad.0.pro tests-obsolete obsolete,atf
+./usr/tests/usr.bin/indent/surplusbad.0.stdout tests-obsolete obsolete,atf
./usr/tests/usr.bin/indent/t_errors tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/indent/t_indent tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/indent/t_misc tests-usr.bin-tests compattestfile,atf
@@ -5199,8 +5199,8 @@
./usr/tests/usr.bin/indent/types_from_file.0.list tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/indent/types_from_file.0.pro tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/indent/types_from_file.0.stdout tests-usr.bin-tests compattestfile,atf
-./usr/tests/usr.bin/indent/wchar.0 tests-usr.bin-tests compattestfile,atf
-./usr/tests/usr.bin/indent/wchar.0.stdout tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/indent/wchar.0 tests-obsolete obsolete,atf
+./usr/tests/usr.bin/indent/wchar.0.stdout tests-obsolete obsolete,atf
./usr/tests/usr.bin/infocmp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/infocmp/Atffile tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/infocmp/Kyuafile tests-usr.bin-tests compattestfile,atf,kyua
Index: src/tests/usr.bin/indent/Makefile
diff -u src/tests/usr.bin/indent/Makefile:1.25 src/tests/usr.bin/indent/Makefile:1.26
--- src/tests/usr.bin/indent/Makefile:1.25 Fri Oct 22 19:27:53 2021
+++ src/tests/usr.bin/indent/Makefile Fri Oct 22 19:46:41 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.25 2021/10/22 19:27:53 rillig Exp $
+# $NetBSD: Makefile,v 1.26 2021/10/22 19:46:41 rillig Exp $
.include <bsd.own.mk>
@@ -116,15 +116,7 @@ FILES+= opt_sc.c
FILES+= opt_sob.c
FILES+= opt_ut.c
FILES+= opt_v.c
-FILES+= parens.0
-FILES+= parens.0.stdout
-FILES+= parens.0.pro
FILES+= ps_ind_level.c
-FILES+= struct.0
-FILES+= struct.0.stdout
-FILES+= surplusbad.0
-FILES+= surplusbad.0.stdout
-FILES+= surplusbad.0.pro
FILES+= t_options.awk
FILES+= token_binary_op.c
FILES+= token_case_label.c
@@ -168,8 +160,6 @@ FILES+= types_from_file.0
FILES+= types_from_file.0.stdout
FILES+= types_from_file.0.list
FILES+= types_from_file.0.pro
-FILES+= wchar.0
-FILES+= wchar.0.stdout
add-test: .PHONY
@set -eu; \
Index: src/tests/usr.bin/indent/opt_bad.c
diff -u src/tests/usr.bin/indent/opt_bad.c:1.3 src/tests/usr.bin/indent/opt_bad.c:1.4
--- src/tests/usr.bin/indent/opt_bad.c:1.3 Mon Oct 18 07:11:31 2021
+++ src/tests/usr.bin/indent/opt_bad.c Fri Oct 22 19:46:41 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_bad.c,v 1.3 2021/10/18 07:11:31 rillig Exp $ */
+/* $NetBSD: opt_bad.c,v 1.4 2021/10/22 19:46:41 rillig Exp $ */
/* $FreeBSD$ */
/*
@@ -30,6 +30,29 @@ void function_declaration(void);
#indent run-equals-prev-output -nbad
+
+/* See FreeBSD r303599. */
+#indent input
+#if defined(__i386__)
+int a;
+#elif defined(__amd64__)
+int b;
+#else
+#error "Port me"
+#endif
+#indent end
+
+#indent run -bad
+#if defined(__i386__)
+int a;
+#elif defined(__amd64__)
+int b;
+#else
+#error "Port me"
+#endif
+#indent end
+
+
/* Test local declarations. */
#indent input
void function_definition(void) {
Index: src/tests/usr.bin/indent/token_keyword_struct_union_enum.c
diff -u src/tests/usr.bin/indent/token_keyword_struct_union_enum.c:1.1 src/tests/usr.bin/indent/token_keyword_struct_union_enum.c:1.2
--- src/tests/usr.bin/indent/token_keyword_struct_union_enum.c:1.1 Mon Oct 18 22:30:34 2021
+++ src/tests/usr.bin/indent/token_keyword_struct_union_enum.c Fri Oct 22 19:46:41 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: token_keyword_struct_union_enum.c,v 1.1 2021/10/18 22:30:34 rillig Exp $ */
+/* $NetBSD: token_keyword_struct_union_enum.c,v 1.2 2021/10/22 19:46:41 rillig Exp $ */
/* $FreeBSD$ */
/*
@@ -21,3 +21,50 @@ union variant {
#indent end
#indent run-equals-input
+
+
+/* See FreeBSD r303485. */
+/* $FreeBSD: head/usr.bin/indent/tests/struct.0 334564 2018-06-03 16:21:15Z pstef $ */
+#indent input
+int f(struct x *a);
+
+void
+t(void)
+{
+ static const struct {
+ int a;
+ int b;
+ } c[] = {
+ { D, E },
+ { F, G }
+ };
+}
+
+void u(struct x a) {
+ int b;
+ struct y c = (struct y *)&a;
+}
+#indent end
+
+#indent run
+int f(struct x *a);
+
+void
+t(void)
+{
+ static const struct {
+ int a;
+ int b;
+ } c[] = {
+ {D, E},
+ {F, G}
+ };
+}
+
+void
+u(struct x a)
+{
+ int b;
+ struct y c = (struct y *)&a;
+}
+#indent end
Index: src/tests/usr.bin/indent/token_string_prefix.c
diff -u src/tests/usr.bin/indent/token_string_prefix.c:1.1 src/tests/usr.bin/indent/token_string_prefix.c:1.2
--- src/tests/usr.bin/indent/token_string_prefix.c:1.1 Mon Oct 18 22:30:34 2021
+++ src/tests/usr.bin/indent/token_string_prefix.c Fri Oct 22 19:46:41 2021
@@ -1,8 +1,10 @@
-/* $NetBSD: token_string_prefix.c,v 1.1 2021/10/18 22:30:34 rillig Exp $ */
+/* $NetBSD: token_string_prefix.c,v 1.2 2021/10/22 19:46:41 rillig Exp $ */
/* $FreeBSD$ */
/*
* Tests for strings of wide characters, which are prefixed with 'L'.
+ *
+ * See FreeBSD r309220.
*/
#indent input
@@ -16,3 +18,10 @@ wchar_t wide_string[] = L"wide string";
#indent run-equals-input -di0
#indent run-equals-input -di0 -l25
#indent run-equals-input -di0 -l1
+
+
+#indent input
+wchar_t wide_char[] = L'w';
+#indent end
+
+#indent run-equals-input -di0