Reference PRs consistently.diff -r1.7 -r1.8 src/tests/lib/libc/sys/t_kevent.c
(jruoho)
--- src/tests/lib/libc/sys/t_kevent.c 2015/02/05 13:55:37 1.7
+++ src/tests/lib/libc/sys/t_kevent.c 2020/06/25 11:12:03 1.8
@@ -1,186 +1,186 @@ | @@ -1,186 +1,186 @@ | |||
1 | /* $NetBSD: t_kevent.c,v 1.7 2015/02/05 13:55:37 isaki Exp $ */ | 1 | /* $NetBSD: t_kevent.c,v 1.8 2020/06/25 11:12:03 jruoho Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundatiom | 7 | * This code is derived from software contributed to The NetBSD Foundatiom | |
8 | * by Christos Zoulas. | 8 | * by Christos Zoulas. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
15 | * 2. Redistributions in binary form must reproduce the above copyright | 15 | * 2. Redistributions in binary form must reproduce the above copyright | |
16 | * notice, this list of conditions and the following disclaimer in the | 16 | * notice, this list of conditions and the following disclaimer in the | |
17 | * documentation and/or other materials provided with the distribution. | 17 | * documentation and/or other materials provided with the distribution. | |
18 | * | 18 | * | |
19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 19 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | #include <sys/cdefs.h> | 31 | #include <sys/cdefs.h> | |
32 | __RCSID("$NetBSD: t_kevent.c,v 1.7 2015/02/05 13:55:37 isaki Exp $"); | 32 | __RCSID("$NetBSD: t_kevent.c,v 1.8 2020/06/25 11:12:03 jruoho Exp $"); | |
33 | 33 | |||
34 | #include <sys/types.h> | 34 | #include <sys/types.h> | |
35 | #include <sys/event.h> | 35 | #include <sys/event.h> | |
36 | 36 | |||
37 | #include <atf-c.h> | 37 | #include <atf-c.h> | |
38 | #include <errno.h> | 38 | #include <errno.h> | |
39 | #include <time.h> | 39 | #include <time.h> | |
40 | #include <stdio.h> | 40 | #include <stdio.h> | |
41 | #include <stdlib.h> | 41 | #include <stdlib.h> | |
42 | #include <string.h> | 42 | #include <string.h> | |
43 | #include <unistd.h> | 43 | #include <unistd.h> | |
44 | #include <fcntl.h> | 44 | #include <fcntl.h> | |
45 | #include <err.h> | 45 | #include <err.h> | |
46 | #include <sys/drvctlio.h> | 46 | #include <sys/drvctlio.h> | |
47 | #include <sys/event.h> | 47 | #include <sys/event.h> | |
48 | #include <sys/time.h> | 48 | #include <sys/time.h> | |
49 | #include <sys/socket.h> | 49 | #include <sys/socket.h> | |
50 | #include <sys/wait.h> | 50 | #include <sys/wait.h> | |
51 | 51 | |||
52 | ATF_TC(kevent_zerotimer); | 52 | ATF_TC(kevent_zerotimer); | |
53 | ATF_TC_HEAD(kevent_zerotimer, tc) | 53 | ATF_TC_HEAD(kevent_zerotimer, tc) | |
54 | { | 54 | { | |
55 | atf_tc_set_md_var(tc, "descr", "Checks that kevent with a 0 timer " | 55 | atf_tc_set_md_var(tc, "descr", "Checks that kevent with a 0 timer " | |
56 | "does not crash the system (PR lib/45618)"); | 56 | "does not crash the system (PR lib/45618)"); | |
57 | } | 57 | } | |
58 | 58 | |||
59 | ATF_TC_BODY(kevent_zerotimer, tc) | 59 | ATF_TC_BODY(kevent_zerotimer, tc) | |
60 | { | 60 | { | |
61 | struct kevent ev; | 61 | struct kevent ev; | |
62 | int kq; | 62 | int kq; | |
63 | 63 | |||
64 | ATF_REQUIRE((kq = kqueue()) != -1); | 64 | ATF_REQUIRE((kq = kqueue()) != -1); | |
65 | EV_SET(&ev, 1, EVFILT_TIMER, EV_ADD|EV_ENABLE, 0, 1, 0); | 65 | EV_SET(&ev, 1, EVFILT_TIMER, EV_ADD|EV_ENABLE, 0, 1, 0); | |
66 | ATF_REQUIRE(kevent(kq, &ev, 1, NULL, 0, NULL) != -1); | 66 | ATF_REQUIRE(kevent(kq, &ev, 1, NULL, 0, NULL) != -1); | |
67 | ATF_REQUIRE(kevent(kq, NULL, 0, &ev, 1, NULL) == 1); | 67 | ATF_REQUIRE(kevent(kq, NULL, 0, &ev, 1, NULL) == 1); | |
68 | } | 68 | } | |
69 | 69 | |||
70 | ATF_TC(kqueue_desc_passing); | 70 | ATF_TC(kqueue_desc_passing); | |
71 | ATF_TC_HEAD(kqueue_desc_passing, tc) | 71 | ATF_TC_HEAD(kqueue_desc_passing, tc) | |
72 | { | 72 | { | |
73 | atf_tc_set_md_var(tc, "descr", "Checks that passing a kqueue to " | 73 | atf_tc_set_md_var(tc, "descr", "Checks that passing a kqueue to " | |
74 | "another process does not crash the kernel (PR 46463)"); | 74 | "another process does not crash the kernel (PR 46463)"); | |
75 | } | 75 | } | |
76 | 76 | |||
77 | ATF_TC_BODY(kqueue_desc_passing, tc) | 77 | ATF_TC_BODY(kqueue_desc_passing, tc) | |
78 | { | 78 | { | |
79 | pid_t child; | 79 | pid_t child; | |
80 | int s[2], storage, status, kq; | 80 | int s[2], storage, status, kq; | |
81 | struct cmsghdr *msg; | 81 | struct cmsghdr *msg; | |
82 | struct iovec iov; | 82 | struct iovec iov; | |
83 | struct msghdr m; | 83 | struct msghdr m; | |
84 | struct kevent ev; | 84 | struct kevent ev; | |
85 | 85 | |||
86 | ATF_REQUIRE((kq = kqueue()) != -1); | 86 | ATF_REQUIRE((kq = kqueue()) != -1); | |
87 | 87 | |||
88 | // atf_tc_skip("crashes kernel (PR 46463)"); | 88 | // atf_tc_skip("crashes kernel (PR kern/46463)"); | |
89 | 89 | |||
90 | ATF_REQUIRE(socketpair(AF_LOCAL, SOCK_STREAM, 0, s) != -1); | 90 | ATF_REQUIRE(socketpair(AF_LOCAL, SOCK_STREAM, 0, s) != -1); | |
91 | msg = malloc(CMSG_SPACE(sizeof(int))); | 91 | msg = malloc(CMSG_SPACE(sizeof(int))); | |
92 | m.msg_iov = &iov; | 92 | m.msg_iov = &iov; | |
93 | m.msg_iovlen = 1; | 93 | m.msg_iovlen = 1; | |
94 | m.msg_name = NULL; | 94 | m.msg_name = NULL; | |
95 | m.msg_namelen = 0; | 95 | m.msg_namelen = 0; | |
96 | m.msg_control = msg; | 96 | m.msg_control = msg; | |
97 | m.msg_controllen = CMSG_SPACE(sizeof(int)); | 97 | m.msg_controllen = CMSG_SPACE(sizeof(int)); | |
98 | 98 | |||
99 | child = fork(); | 99 | child = fork(); | |
100 | if (child == 0) { | 100 | if (child == 0) { | |
101 | close(s[0]); | 101 | close(s[0]); | |
102 | 102 | |||
103 | iov.iov_base = &storage; | 103 | iov.iov_base = &storage; | |
104 | iov.iov_len = sizeof(int); | 104 | iov.iov_len = sizeof(int); | |
105 | m.msg_iov = &iov; | 105 | m.msg_iov = &iov; | |
106 | m.msg_iovlen = 1; | 106 | m.msg_iovlen = 1; | |
107 | 107 | |||
108 | if (recvmsg(s[1], &m, 0) == -1) | 108 | if (recvmsg(s[1], &m, 0) == -1) | |
109 | err(1, "child: could not recvmsg"); | 109 | err(1, "child: could not recvmsg"); | |
110 | 110 | |||
111 | kq = *(int *)CMSG_DATA(msg); | 111 | kq = *(int *)CMSG_DATA(msg); | |
112 | printf("child (pid %d): received kq fd %d\n", getpid(), kq); | 112 | printf("child (pid %d): received kq fd %d\n", getpid(), kq); | |
113 | exit(0); | 113 | exit(0); | |
114 | } | 114 | } | |
115 | 115 | |||
116 | close(s[1]); | 116 | close(s[1]); | |
117 | 117 | |||
118 | iov.iov_base = &storage; | 118 | iov.iov_base = &storage; | |
119 | iov.iov_len = sizeof(int); | 119 | iov.iov_len = sizeof(int); | |
120 | 120 | |||
121 | msg->cmsg_level = SOL_SOCKET; | 121 | msg->cmsg_level = SOL_SOCKET; | |
122 | msg->cmsg_type = SCM_RIGHTS; | 122 | msg->cmsg_type = SCM_RIGHTS; | |
123 | msg->cmsg_len = CMSG_LEN(sizeof(int)); | 123 | msg->cmsg_len = CMSG_LEN(sizeof(int)); | |
124 | 124 | |||
125 | *(int *)CMSG_DATA(msg) = kq; | 125 | *(int *)CMSG_DATA(msg) = kq; | |
126 | 126 | |||
127 | EV_SET(&ev, 1, EVFILT_TIMER, EV_ADD|EV_ENABLE, 0, 1, 0); | 127 | EV_SET(&ev, 1, EVFILT_TIMER, EV_ADD|EV_ENABLE, 0, 1, 0); | |
128 | ATF_CHECK(kevent(kq, &ev, 1, NULL, 0, NULL) != -1); | 128 | ATF_CHECK(kevent(kq, &ev, 1, NULL, 0, NULL) != -1); | |
129 | 129 | |||
130 | printf("parent (pid %d): sending kq fd %d\n", getpid(), kq); | 130 | printf("parent (pid %d): sending kq fd %d\n", getpid(), kq); | |
131 | if (sendmsg(s[0], &m, 0) == -1) { | 131 | if (sendmsg(s[0], &m, 0) == -1) { | |
132 | ATF_REQUIRE_EQ_MSG(errno, EBADF, "errno is %d", errno); | 132 | ATF_REQUIRE_EQ_MSG(errno, EBADF, "errno is %d", errno); | |
133 | atf_tc_skip("PR kern/46523"); | 133 | atf_tc_skip("PR kern/46523"); | |
134 | } | 134 | } | |
135 | 135 | |||
136 | close(kq); | 136 | close(kq); | |
137 | 137 | |||
138 | waitpid(child, &status, 0); | 138 | waitpid(child, &status, 0); | |
139 | ATF_CHECK(WIFEXITED(status) && WEXITSTATUS(status)==0); | 139 | ATF_CHECK(WIFEXITED(status) && WEXITSTATUS(status)==0); | |
140 | } | 140 | } | |
141 | 141 | |||
142 | ATF_TC(kqueue_unsupported_fd); | 142 | ATF_TC(kqueue_unsupported_fd); | |
143 | ATF_TC_HEAD(kqueue_unsupported_fd, tc) | 143 | ATF_TC_HEAD(kqueue_unsupported_fd, tc) | |
144 | { | 144 | { | |
145 | atf_tc_set_md_var(tc, "descr", "Checks that watching an fd whose" | 145 | atf_tc_set_md_var(tc, "descr", "Checks that watching an fd whose" | |
146 | " type is not supported does not crash the kernel"); | 146 | " type is not supported does not crash the kernel"); | |
147 | } | 147 | } | |
148 | 148 | |||
149 | ATF_TC_BODY(kqueue_unsupported_fd, tc) | 149 | ATF_TC_BODY(kqueue_unsupported_fd, tc) | |
150 | { | 150 | { | |
151 | /* mqueue and semaphore use fnullop_kqueue also */ | 151 | /* mqueue and semaphore use fnullop_kqueue also */ | |
152 | int fd, kq; | 152 | int fd, kq; | |
153 | struct kevent ev; | 153 | struct kevent ev; | |
154 | 154 | |||
155 | fd = open(DRVCTLDEV, O_RDONLY); | 155 | fd = open(DRVCTLDEV, O_RDONLY); | |
156 | if (fd == -1) { | 156 | if (fd == -1) { | |
157 | switch (errno) { | 157 | switch (errno) { | |
158 | case ENOENT: | 158 | case ENOENT: | |
159 | case ENXIO: | 159 | case ENXIO: | |
160 | atf_tc_skip("no " DRVCTLDEV " available for testing"); | 160 | atf_tc_skip("no " DRVCTLDEV " available for testing"); | |
161 | break; | 161 | break; | |
162 | } | 162 | } | |
163 | } | 163 | } | |
164 | ATF_REQUIRE(fd != -1); | 164 | ATF_REQUIRE(fd != -1); | |
165 | ATF_REQUIRE((kq = kqueue()) != -1); | 165 | ATF_REQUIRE((kq = kqueue()) != -1); | |
166 | 166 | |||
167 | EV_SET(&ev, fd, EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_CLEAR, | 167 | EV_SET(&ev, fd, EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_CLEAR, | |
168 | NOTE_DELETE|NOTE_WRITE|NOTE_EXTEND|NOTE_ATTRIB|NOTE_LINK| | 168 | NOTE_DELETE|NOTE_WRITE|NOTE_EXTEND|NOTE_ATTRIB|NOTE_LINK| | |
169 | NOTE_RENAME|NOTE_REVOKE, 0, 0); | 169 | NOTE_RENAME|NOTE_REVOKE, 0, 0); | |
170 | 170 | |||
171 | ATF_REQUIRE(kevent(kq, &ev, 1, NULL, 0, NULL) == -1); | 171 | ATF_REQUIRE(kevent(kq, &ev, 1, NULL, 0, NULL) == -1); | |
172 | ATF_REQUIRE_ERRNO(EOPNOTSUPP, true); | 172 | ATF_REQUIRE_ERRNO(EOPNOTSUPP, true); | |
173 | 173 | |||
174 | (void)close(fd); | 174 | (void)close(fd); | |
175 | } | 175 | } | |
176 | 176 | |||
177 | 177 | |||
178 | ATF_TP_ADD_TCS(tp) | 178 | ATF_TP_ADD_TCS(tp) | |
179 | { | 179 | { | |
180 | 180 | |||
181 | ATF_TP_ADD_TC(tp, kevent_zerotimer); | 181 | ATF_TP_ADD_TC(tp, kevent_zerotimer); | |
182 | ATF_TP_ADD_TC(tp, kqueue_desc_passing); | 182 | ATF_TP_ADD_TC(tp, kqueue_desc_passing); | |
183 | ATF_TP_ADD_TC(tp, kqueue_unsupported_fd); | 183 | ATF_TP_ADD_TC(tp, kqueue_unsupported_fd); | |
184 | 184 | |||
185 | return atf_no_error(); | 185 | return atf_no_error(); | |
186 | } | 186 | } |
--- src/tests/lib/libm/t_hypot.c 2016/01/24 20:26:47 1.1
+++ src/tests/lib/libm/t_hypot.c 2020/06/25 11:12:03 1.2
@@ -1,81 +1,81 @@ | @@ -1,81 +1,81 @@ | |||
1 | /* $NetBSD: t_hypot.c,v 1.1 2016/01/24 20:26:47 gson Exp $ */ | 1 | /* $NetBSD: t_hypot.c,v 1.2 2020/06/25 11:12:03 jruoho Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2016 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2016 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
15 | * | 15 | * | |
16 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 16 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |
17 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 17 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 19 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 20 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
26 | * POSSIBILITY OF SUCH DAMAGE. | 26 | * POSSIBILITY OF SUCH DAMAGE. | |
27 | */ | 27 | */ | |
28 | 28 | |||
29 | #include <atf-c.h> | 29 | #include <atf-c.h> | |
30 | #include <math.h> | 30 | #include <math.h> | |
31 | 31 | |||
32 | ATF_TC(hypot_integer); | 32 | ATF_TC(hypot_integer); | |
33 | ATF_TC_HEAD(hypot_integer, tc) | 33 | ATF_TC_HEAD(hypot_integer, tc) | |
34 | { | 34 | { | |
35 | atf_tc_set_md_var(tc, "descr", "Test hypot with integer args"); | 35 | atf_tc_set_md_var(tc, "descr", "Test hypot with integer args"); | |
36 | } | 36 | } | |
37 | 37 | |||
38 | ATF_TC_BODY(hypot_integer, tc) | 38 | ATF_TC_BODY(hypot_integer, tc) | |
39 | { | 39 | { | |
40 | /* volatile so hypotf() won't be evaluated at compile time */ | 40 | /* volatile so hypotf() won't be evaluated at compile time */ | |
41 | volatile double a = 5; | 41 | volatile double a = 5; | |
42 | volatile double b = 12; | 42 | volatile double b = 12; | |
43 | ATF_CHECK(hypot(a, b) == 13.0); | 43 | ATF_CHECK(hypot(a, b) == 13.0); | |
44 | } | 44 | } | |
45 | 45 | |||
46 | ATF_TC(hypotf_integer); | 46 | ATF_TC(hypotf_integer); | |
47 | ATF_TC_HEAD(hypotf_integer, tc) | 47 | ATF_TC_HEAD(hypotf_integer, tc) | |
48 | { | 48 | { | |
49 | atf_tc_set_md_var(tc, "descr", "Test hypotf with integer args"); | 49 | atf_tc_set_md_var(tc, "descr", "Test hypotf with integer args"); | |
50 | } | 50 | } | |
51 | 51 | |||
52 | ATF_TC_BODY(hypotf_integer, tc) | 52 | ATF_TC_BODY(hypotf_integer, tc) | |
53 | { | 53 | { | |
54 | volatile float a = 5; | 54 | volatile float a = 5; | |
55 | volatile float b = 12; | 55 | volatile float b = 12; | |
56 | ATF_CHECK(hypotf(a, b) == 13.0f); | 56 | ATF_CHECK(hypotf(a, b) == 13.0f); | |
57 | } | 57 | } | |
58 | 58 | |||
59 | ATF_TC(pr50698); | 59 | ATF_TC(pr50698); | |
60 | ATF_TC_HEAD(pr50698, tc) | 60 | ATF_TC_HEAD(pr50698, tc) | |
61 | { | 61 | { | |
62 | atf_tc_set_md_var(tc, "descr", "Check for the bug of PR 50698"); | 62 | atf_tc_set_md_var(tc, "descr", "Check for the bug of PR lib/50698"); | |
63 | } | 63 | } | |
64 | 64 | |||
65 | ATF_TC_BODY(pr50698, tc) | 65 | ATF_TC_BODY(pr50698, tc) | |
66 | { | 66 | { | |
67 | volatile float a = 1e-18f; | 67 | volatile float a = 1e-18f; | |
68 | float val = hypotf(a, a); | 68 | float val = hypotf(a, a); | |
69 | ATF_CHECK(!isinf(val)); | 69 | ATF_CHECK(!isinf(val)); | |
70 | ATF_CHECK(!isnan(val)); | 70 | ATF_CHECK(!isnan(val)); | |
71 | } | 71 | } | |
72 | 72 | |||
73 | ATF_TP_ADD_TCS(tp) | 73 | ATF_TP_ADD_TCS(tp) | |
74 | { | 74 | { | |
75 | 75 | |||
76 | ATF_TP_ADD_TC(tp, hypot_integer); | 76 | ATF_TP_ADD_TC(tp, hypot_integer); | |
77 | ATF_TP_ADD_TC(tp, hypotf_integer); | 77 | ATF_TP_ADD_TC(tp, hypotf_integer); | |
78 | ATF_TP_ADD_TC(tp, pr50698); | 78 | ATF_TP_ADD_TC(tp, pr50698); | |
79 | 79 | |||
80 | return atf_no_error(); | 80 | return atf_no_error(); | |
81 | } | 81 | } |
--- src/tests/usr.bin/gdb/t_regress.sh 2019/06/07 19:05:15 1.2
+++ src/tests/usr.bin/gdb/t_regress.sh 2020/06/25 11:12:03 1.3
@@ -1,98 +1,95 @@ | @@ -1,98 +1,95 @@ | |||
1 | # $NetBSD: t_regress.sh,v 1.2 2019/06/07 19:05:15 gson Exp $ | 1 | # $NetBSD: t_regress.sh,v 1.3 2020/06/25 11:12:03 jruoho Exp $ | |
2 | # | 2 | # | |
3 | # Copyright (c) 2016 The NetBSD Foundation, Inc. | 3 | # Copyright (c) 2016 The NetBSD Foundation, Inc. | |
4 | # All rights reserved. | 4 | # All rights reserved. | |
5 | # | 5 | # | |
6 | # Redistribution and use in source and binary forms, with or without | 6 | # Redistribution and use in source and binary forms, with or without | |
7 | # modification, are permitted provided that the following conditions | 7 | # modification, are permitted provided that the following conditions | |
8 | # are met: | 8 | # are met: | |
9 | # 1. Redistributions of source code must retain the above copyright | 9 | # 1. Redistributions of source code must retain the above copyright | |
10 | # notice, this list of conditions and the following disclaimer. | 10 | # notice, this list of conditions and the following disclaimer. | |
11 | # 2. Redistributions in binary form must reproduce the above copyright | 11 | # 2. Redistributions in binary form must reproduce the above copyright | |
12 | # notice, this list of conditions and the following disclaimer in the | 12 | # notice, this list of conditions and the following disclaimer in the | |
13 | # documentation and/or other materials provided with the distribution. | 13 | # documentation and/or other materials provided with the distribution. | |
14 | # | 14 | # | |
15 | # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 15 | # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |
16 | # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 16 | # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
17 | # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 17 | # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
19 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 19 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
20 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 20 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
21 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 21 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
22 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 22 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
23 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 23 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
24 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 24 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
25 | # POSSIBILITY OF SUCH DAMAGE. | 25 | # POSSIBILITY OF SUCH DAMAGE. | |
26 | # | 26 | # | |
27 | 27 | |||
28 | # Regression tests for some GDB PRs | 28 | # Regression tests for some GDB PRs | |
29 | 29 | |||
30 | # PR 47430 | |||
31 | ||||
32 | atf_test_case threads | 30 | atf_test_case threads | |
33 | threads_head() { | 31 | threads_head() { | |
34 | atf_set "descr" "Test that gdb works with threaded programs" | 32 | atf_set "descr" "Test that gdb works with " \ | |
33 | "threaded programs (PR bin/47430)" | |||
35 | atf_set "require.progs" "gdb" | 34 | atf_set "require.progs" "gdb" | |
36 | } | 35 | } | |
37 | threads_body() { | 36 | threads_body() { | |
38 | # Dig at an unused IP address so that dig fails the | 37 | # Dig at an unused IP address so that dig fails the | |
39 | # same way on machines with Internet connectivity | 38 | # same way on machines with Internet connectivity | |
40 | # as on those without. | 39 | # as on those without. | |
41 | cat <<EOF >test.gdb | 40 | cat <<EOF >test.gdb | |
42 | run +time=1 +tries=1 @127.0.0.177 | 41 | run +time=1 +tries=1 @127.0.0.177 | |
43 | cont | 42 | cont | |
44 | cont | 43 | cont | |
45 | cont | 44 | cont | |
46 | cont | 45 | cont | |
47 | cont | 46 | cont | |
48 | EOF | 47 | EOF | |
49 | gdb --batch -x test.gdb dig >gdb.out | 48 | gdb --batch -x test.gdb dig >gdb.out | |
50 | atf_check -s exit:1 -o ignore -e ignore grep "Program received signal SIGTRAP" gdb.out | 49 | atf_check -s exit:1 -o ignore -e ignore grep "Program received signal SIGTRAP" gdb.out | |
51 | } | 50 | } | |
52 | 51 | |||
53 | # PR 48250 | |||
54 | ||||
55 | atf_test_case pie | 52 | atf_test_case pie | |
56 | pie_head() { | 53 | pie_head() { | |
57 | atf_set "descr" "Test that gdb works with PIE executables" | 54 | atf_set "descr" "Test that gdb works with " \ | |
55 | "PIE executables (PR bin/48250)" | |||
58 | atf_set "require.progs" "cc gdb" | 56 | atf_set "require.progs" "cc gdb" | |
59 | } | 57 | } | |
60 | pie_body() { | 58 | pie_body() { | |
61 | cat <<\EOF >test.c | 59 | cat <<\EOF >test.c | |
62 | #include <stdio.h> | 60 | #include <stdio.h> | |
63 | int main(int argc, char **argv) { printf ("hello\n"); return 0; } | 61 | int main(int argc, char **argv) { printf ("hello\n"); return 0; } | |
64 | EOF | 62 | EOF | |
65 | cc -fpie -pie -g test.c -o test | 63 | cc -fpie -pie -g test.c -o test | |
66 | cat <<EOF >test.gdb | 64 | cat <<EOF >test.gdb | |
67 | break main | 65 | break main | |
68 | run | 66 | run | |
69 | EOF | 67 | EOF | |
70 | gdb --batch -x test.gdb ./test >gdb.out 2>&1 | 68 | gdb --batch -x test.gdb ./test >gdb.out 2>&1 | |
71 | atf_check -s exit:1 -o ignore -e ignore grep "annot access memory" gdb.out | 69 | atf_check -s exit:1 -o ignore -e ignore grep "annot access memory" gdb.out | |
72 | } | 70 | } | |
73 | 71 | |||
74 | # PR 54154 | |||
75 | ||||
76 | atf_test_case xml | 72 | atf_test_case xml | |
77 | xml_head() { | 73 | xml_head() { | |
78 | atf_set "descr" "Test that gdb was built with XML support" | 74 | atf_set "descr" "Test that gdb was built " \ | |
75 | "with XML support (PR bin/54154)" | |||
79 | atf_set "require.progs" "gdb" | 76 | atf_set "require.progs" "gdb" | |
80 | } | 77 | } | |
81 | xml_body() { | 78 | xml_body() { | |
82 | cat <<\EOF >target.xml | 79 | cat <<\EOF >target.xml | |
83 | <target version="1.0"> | 80 | <target version="1.0"> | |
84 | <architecture>i386:x86-64</architecture> | 81 | <architecture>i386:x86-64</architecture> | |
85 | </target> | 82 | </target> | |
86 | EOF | 83 | EOF | |
87 | cat <<EOF >test.gdb | 84 | cat <<EOF >test.gdb | |
88 | set tdesc filename "target.xml" | 85 | set tdesc filename "target.xml" | |
89 | EOF | 86 | EOF | |
90 | gdb --batch -x test.gdb >gdb.out 2>&1 | 87 | gdb --batch -x test.gdb >gdb.out 2>&1 | |
91 | atf_check -s exit:1 -o ignore -e ignore grep "Can not parse XML" gdb.out | 88 | atf_check -s exit:1 -o ignore -e ignore grep "Can not parse XML" gdb.out | |
92 | } | 89 | } | |
93 | 90 | |||
94 | atf_init_test_cases() { | 91 | atf_init_test_cases() { | |
95 | atf_add_test_case threads | 92 | atf_add_test_case threads | |
96 | atf_add_test_case pie | 93 | atf_add_test_case pie | |
97 | atf_add_test_case xml | 94 | atf_add_test_case xml | |
98 | } | 95 | } |
--- src/tests/usr.bin/vmstat/t_vmstat.sh 2014/01/07 16:47:13 1.1
+++ src/tests/usr.bin/vmstat/t_vmstat.sh 2020/06/25 11:12:03 1.2
@@ -1,48 +1,50 @@ | @@ -1,48 +1,50 @@ | |||
1 | # $NetBSD: t_vmstat.sh,v 1.1 2014/01/07 16:47:13 gson Exp $ | 1 | # $NetBSD: t_vmstat.sh,v 1.2 2020/06/25 11:12:03 jruoho Exp $ | |
2 | # | 2 | # | |
3 | # Copyright (c) 2013 The NetBSD Foundation, Inc. | 3 | # Copyright (c) 2013 The NetBSD Foundation, Inc. | |
4 | # All rights reserved. | 4 | # All rights reserved. | |
5 | # | 5 | # | |
6 | # Redistribution and use in source and binary forms, with or without | 6 | # Redistribution and use in source and binary forms, with or without | |
7 | # modification, are permitted provided that the following conditions | 7 | # modification, are permitted provided that the following conditions | |
8 | # are met: | 8 | # are met: | |
9 | # 1. Redistributions of source code must retain the above copyright | 9 | # 1. Redistributions of source code must retain the above copyright | |
10 | # notice, this list of conditions and the following disclaimer. | 10 | # notice, this list of conditions and the following disclaimer. | |
11 | # 2. Redistributions in binary form must reproduce the above copyright | 11 | # 2. Redistributions in binary form must reproduce the above copyright | |
12 | # notice, this list of conditions and the following disclaimer in the | 12 | # notice, this list of conditions and the following disclaimer in the | |
13 | # documentation and/or other materials provided with the distribution. | 13 | # documentation and/or other materials provided with the distribution. | |
14 | # | 14 | # | |
15 | # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 15 | # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |
16 | # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 16 | # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
17 | # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 17 | # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
19 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 19 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
20 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 20 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
21 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 21 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
22 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 22 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
23 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 23 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
24 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 24 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
25 | # POSSIBILITY OF SUCH DAMAGE. | 25 | # POSSIBILITY OF SUCH DAMAGE. | |
26 | # | 26 | # | |
27 | 27 | |||
28 | atf_test_case default | 28 | atf_test_case default | |
29 | default_head() { | 29 | default_head() { | |
30 | atf_set "descr" "Test that vmstat(1) returns success when run with no arguments" | 30 | atf_set "descr" "Test that vmstat(1) returns " \ | |
31 | "success when run with no arguments" | |||
31 | } | 32 | } | |
32 | default_body() { | 33 | default_body() { | |
33 | atf_check -s exit:0 -o ignore -e empty vmstat | 34 | atf_check -s exit:0 -o ignore -e empty vmstat | |
34 | } | 35 | } | |
35 | 36 | |||
36 | atf_test_case opt_s | 37 | atf_test_case opt_s | |
37 | opt_s_head() { | 38 | opt_s_head() { | |
38 | atf_set "descr" "Test that vmstat(1) returns success when run with -s (PR 44518)" | 39 | atf_set "descr" "Test that vmstat(1) returns " \ | |
40 | "success when run with -s (PR bin/44518)" | |||
39 | } | 41 | } | |
40 | opt_s_body() { | 42 | opt_s_body() { | |
41 | atf_check -s exit:0 -o ignore -e empty vmstat -s | 43 | atf_check -s exit:0 -o ignore -e empty vmstat -s | |
42 | } | 44 | } | |
43 | 45 | |||
44 | atf_init_test_cases() | 46 | atf_init_test_cases() | |
45 | { | 47 | { | |
46 | atf_add_test_case default | 48 | atf_add_test_case default | |
47 | atf_add_test_case opt_s | 49 | atf_add_test_case opt_s | |
48 | } | 50 | } |
--- src/tests/usr.bin/xlint/lint1/d_long_double_int.c 2012/03/17 16:33:16 1.1
+++ src/tests/usr.bin/xlint/lint1/d_long_double_int.c 2020/06/25 11:12:03 1.2
@@ -1,7 +1,7 @@ | @@ -1,7 +1,7 @@ | |||
1 | /* PR 39639: writing "long double" gave "long int" */ | 1 | /* PR bin/39639: writing "long double" gave "long int" */ | |
2 | 2 | |||
3 | int | 3 | int | |
4 | fail(long double *a, long int *b) | 4 | fail(long double *a, long int *b) | |
5 | { | 5 | { | |
6 | return a == b; | 6 | return a == b; | |
7 | } | 7 | } |
--- src/tests/usr.bin/xlint/lint1/t_integration.sh 2014/04/21 19:10:41 1.4
+++ src/tests/usr.bin/xlint/lint1/t_integration.sh 2020/06/25 11:12:03 1.5
@@ -1,132 +1,132 @@ | @@ -1,132 +1,132 @@ | |||
1 | # $NetBSD: t_integration.sh,v 1.4 2014/04/21 19:10:41 christos Exp $ | 1 | # $NetBSD: t_integration.sh,v 1.5 2020/06/25 11:12:03 jruoho Exp $ | |
2 | # | 2 | # | |
3 | # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc. | 3 | # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc. | |
4 | # All rights reserved. | 4 | # All rights reserved. | |
5 | # | 5 | # | |
6 | # Redistribution and use in source and binary forms, with or without | 6 | # Redistribution and use in source and binary forms, with or without | |
7 | # modification, are permitted provided that the following conditions | 7 | # modification, are permitted provided that the following conditions | |
8 | # are met: | 8 | # are met: | |
9 | # 1. Redistributions of source code must retain the above copyright | 9 | # 1. Redistributions of source code must retain the above copyright | |
10 | # notice, this list of conditions and the following disclaimer. | 10 | # notice, this list of conditions and the following disclaimer. | |
11 | # 2. Redistributions in binary form must reproduce the above copyright | 11 | # 2. Redistributions in binary form must reproduce the above copyright | |
12 | # notice, this list of conditions and the following disclaimer in the | 12 | # notice, this list of conditions and the following disclaimer in the | |
13 | # documentation and/or other materials provided with the distribution. | 13 | # documentation and/or other materials provided with the distribution. | |
14 | # | 14 | # | |
15 | # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 15 | # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |
16 | # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 16 | # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
17 | # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 17 | # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 18 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
19 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 19 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
20 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 20 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
21 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 21 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
22 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 22 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
23 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 23 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
24 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 24 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
25 | # POSSIBILITY OF SUCH DAMAGE. | 25 | # POSSIBILITY OF SUCH DAMAGE. | |
26 | # | 26 | # | |
27 | 27 | |||
28 | LINT1=/usr/libexec/lint1 | 28 | LINT1=/usr/libexec/lint1 | |
29 | 29 | |||
30 | Names= | 30 | Names= | |
31 | 31 | |||
32 | check_valid() | 32 | check_valid() | |
33 | { | 33 | { | |
34 | atf_check -s exit:0 ${LINT1} -g -S "$(atf_get_srcdir)/$1" /dev/null | 34 | atf_check -s exit:0 ${LINT1} -g -S "$(atf_get_srcdir)/$1" /dev/null | |
35 | } | 35 | } | |
36 | 36 | |||
37 | check_invalid() | 37 | check_invalid() | |
38 | { | 38 | { | |
39 | atf_check -s not-exit:0 -o ignore -e ignore ${LINT1} -g -S -w \ | 39 | atf_check -s not-exit:0 -o ignore -e ignore ${LINT1} -g -S -w \ | |
40 | "$(atf_get_srcdir)/$1" /dev/null | 40 | "$(atf_get_srcdir)/$1" /dev/null | |
41 | } | 41 | } | |
42 | 42 | |||
43 | test_case() | 43 | test_case() | |
44 | { | 44 | { | |
45 | local result="${1}"; shift | 45 | local result="${1}"; shift | |
46 | local name="${1}"; shift | 46 | local name="${1}"; shift | |
47 | local descr="${*}" | 47 | local descr="${*}" | |
48 | 48 | |||
49 | atf_test_case ${name} | 49 | atf_test_case ${name} | |
50 | eval "${name}_head() { | 50 | eval "${name}_head() { | |
51 | atf_set \"descr\" \"${descr}\"; | 51 | atf_set \"descr\" \"${descr}\"; | |
52 | atf_set \"require.progs\" \"${LINT1}\"; | 52 | atf_set \"require.progs\" \"${LINT1}\"; | |
53 | }" | 53 | }" | |
54 | eval "${name}_body() { | 54 | eval "${name}_body() { | |
55 | ${result} d_${name}.c; | 55 | ${result} d_${name}.c; | |
56 | }" | 56 | }" | |
57 | 57 | |||
58 | Names="${Names} ${name}" | 58 | Names="${Names} ${name}" | |
59 | } | 59 | } | |
60 | 60 | |||
61 | test_case check_valid c99_struct_init "Checks C99 struct initialization" | 61 | test_case check_valid c99_struct_init "Checks C99 struct initialization" | |
62 | test_case check_valid c99_union_init1 "Checks C99 union initialization" | 62 | test_case check_valid c99_union_init1 "Checks C99 union initialization" | |
63 | test_case check_valid c99_union_init2 "Checks C99 union initialization" | 63 | test_case check_valid c99_union_init2 "Checks C99 union initialization" | |
64 | test_case check_valid c99_union_init3 "Checks C99 union initialization" | 64 | test_case check_valid c99_union_init3 "Checks C99 union initialization" | |
65 | test_case check_valid c99_recursive_init "Checks C99 recursive struct/union" \ | 65 | test_case check_valid c99_recursive_init "Checks C99 recursive struct/union" \ | |
66 | "initialization" | 66 | "initialization" | |
67 | test_case check_valid c9x_recursive_init "Checks C9X struct/union member" \ | 67 | test_case check_valid c9x_recursive_init "Checks C9X struct/union member" \ | |
68 | "init, with nested union and trailing member" | 68 | "init, with nested union and trailing member" | |
69 | test_case check_valid nested_structs "Checks nested structs" | 69 | test_case check_valid nested_structs "Checks nested structs" | |
70 | test_case check_valid packed_structs "Checks packed structs" | 70 | test_case check_valid packed_structs "Checks packed structs" | |
71 | 71 | |||
72 | test_case check_valid cast_init "Checks cast initialization" | 72 | test_case check_valid cast_init "Checks cast initialization" | |
73 | test_case check_valid cast_init2 "Checks cast initialization as the rhs of a" \ | 73 | test_case check_valid cast_init2 "Checks cast initialization as the rhs of a" \ | |
74 | "- operand" | 74 | "- operand" | |
75 | test_case check_valid cast_lhs "Checks whether pointer casts are valid lhs" \ | 75 | test_case check_valid cast_lhs "Checks whether pointer casts are valid lhs" \ | |
76 | "lvalues" | 76 | "lvalues" | |
77 | 77 | |||
78 | test_case check_valid gcc_func "Checks GCC __FUNCTION__" | 78 | test_case check_valid gcc_func "Checks GCC __FUNCTION__" | |
79 | test_case check_valid c99_func "Checks C99 __func__" | 79 | test_case check_valid c99_func "Checks C99 __func__" | |
80 | 80 | |||
81 | test_case check_valid gcc_variable_array_init "Checks GCC variable array" \ | 81 | test_case check_valid gcc_variable_array_init "Checks GCC variable array" \ | |
82 | "initializers" | 82 | "initializers" | |
83 | test_case check_valid c9x_array_init "Checks C9X array initializers" | 83 | test_case check_valid c9x_array_init "Checks C9X array initializers" | |
84 | test_case check_valid c99_decls_after_stmt "Checks C99 decls after statements" | 84 | test_case check_valid c99_decls_after_stmt "Checks C99 decls after statements" | |
85 | test_case check_valid c99_decls_after_stmt3 "Checks C99 decls after statements" | 85 | test_case check_valid c99_decls_after_stmt3 "Checks C99 decls after statements" | |
86 | test_case check_valid nolimit_init "Checks no limit initializers" | 86 | test_case check_valid nolimit_init "Checks no limit initializers" | |
87 | test_case check_valid zero_sized_arrays "Checks zero sized arrays" | 87 | test_case check_valid zero_sized_arrays "Checks zero sized arrays" | |
88 | 88 | |||
89 | test_case check_valid compound_literals1 "Checks compound literals" | 89 | test_case check_valid compound_literals1 "Checks compound literals" | |
90 | test_case check_valid compound_literals2 "Checks compound literals" | 90 | test_case check_valid compound_literals2 "Checks compound literals" | |
91 | test_case check_valid gcc_compound_statements1 "Checks GCC compound statements" | 91 | test_case check_valid gcc_compound_statements1 "Checks GCC compound statements" | |
92 | test_case check_valid gcc_compound_statements2 "Checks GCC compound" \ | 92 | test_case check_valid gcc_compound_statements2 "Checks GCC compound" \ | |
93 | "statements with non-expressions" | 93 | "statements with non-expressions" | |
94 | test_case check_valid gcc_compound_statements3 "Checks GCC compound" \ | 94 | test_case check_valid gcc_compound_statements3 "Checks GCC compound" \ | |
95 | "statements with void type" | 95 | "statements with void type" | |
96 | # XXX: Because of polymorphic __builtin_isnan and expression has null effect | 96 | # XXX: Because of polymorphic __builtin_isnan and expression has null effect | |
97 | # test_case check_valid gcc_extension "Checks GCC __extension__ and __typeof__" | 97 | # test_case check_valid gcc_extension "Checks GCC __extension__ and __typeof__" | |
98 | 98 | |||
99 | test_case check_valid cvt_in_ternary "Checks CVT nodes handling in ?" \ | 99 | test_case check_valid cvt_in_ternary "Checks CVT nodes handling in ?" \ | |
100 | test_case check_valid cvt_constant "Checks constant conversion" | 100 | test_case check_valid cvt_constant "Checks constant conversion" | |
101 | test_case check_valid ellipsis_in_switch "Checks ellipsis in switch()" | 101 | test_case check_valid ellipsis_in_switch "Checks ellipsis in switch()" | |
102 | test_case check_valid c99_complex_num "Checks C99 complex numbers" | 102 | test_case check_valid c99_complex_num "Checks C99 complex numbers" | |
103 | test_case check_valid c99_complex_split "Checks C99 complex access" | 103 | test_case check_valid c99_complex_split "Checks C99 complex access" | |
104 | test_case check_valid c99_for_loops "Checks C99 for loops" | 104 | test_case check_valid c99_for_loops "Checks C99 for loops" | |
105 | test_case check_valid alignof "Checks __alignof__" | 105 | test_case check_valid alignof "Checks __alignof__" | |
106 | test_case check_valid shift_to_narrower_type "Checks that type shifts that" \ | 106 | test_case check_valid shift_to_narrower_type "Checks that type shifts that" \ | |
107 | "result in narrower types do not produce warnings" | 107 | "result in narrower types do not produce warnings" | |
108 | 108 | |||
109 | test_case check_invalid constant_conv1 "Checks failing on information-losing" \ | 109 | test_case check_invalid constant_conv1 "Checks failing on information-losing" \ | |
110 | "constant conversion in argument lists" | 110 | "constant conversion in argument lists" | |
111 | test_case check_invalid constant_conv2 "Checks failing on information-losing" \ | 111 | test_case check_invalid constant_conv2 "Checks failing on information-losing" \ | |
112 | "constant conversion in argument lists" | 112 | "constant conversion in argument lists" | |
113 | 113 | |||
114 | test_case check_invalid type_conv1 "Checks failing on information-losing" \ | 114 | test_case check_invalid type_conv1 "Checks failing on information-losing" \ | |
115 | "type conversion in argument lists" | 115 | "type conversion in argument lists" | |
116 | test_case check_invalid type_conv2 "Checks failing on information-losing" \ | 116 | test_case check_invalid type_conv2 "Checks failing on information-losing" \ | |
117 | "type conversion in argument lists" | 117 | "type conversion in argument lists" | |
118 | test_case check_invalid type_conv3 "Checks failing on information-losing" \ | 118 | test_case check_invalid type_conv3 "Checks failing on information-losing" \ | |
119 | "type conversion in argument lists" | 119 | "type conversion in argument lists" | |
120 | 120 | |||
121 | test_case check_invalid incorrect_array_size "Checks failing on incorrect" \ | 121 | test_case check_invalid incorrect_array_size "Checks failing on incorrect" \ | |
122 | "array sizes" | 122 | "array sizes" | |
123 | 123 | |||
124 | test_case check_invalid long_double_int "Checks for confusion of 'long" \ | 124 | test_case check_invalid long_double_int "Checks for confusion of 'long" \ | |
125 | "double' with 'long int'; PR 39639" | 125 | "double' with 'long int'; PR bin/39639" | |
126 | 126 | |||
127 | atf_init_test_cases() | 127 | atf_init_test_cases() | |
128 | { | 128 | { | |
129 | for name in ${Names}; do | 129 | for name in ${Names}; do | |
130 | atf_add_test_case ${name} | 130 | atf_add_test_case ${name} | |
131 | done | 131 | done | |
132 | } | 132 | } |