Commit | Line | Data |
599cee73 |
1 | pp_sys.c AOK |
2 | |
767a6a26 |
3 | untie attempted while %d inner references still exist [pp_untie] |
599cee73 |
4 | sub TIESCALAR { bless [] } ; tie $a, 'main'; untie $a ; |
5 | |
767a6a26 |
6 | Filehandle %s opened only for input [pp_leavewrite] |
599cee73 |
7 | format STDIN = |
8 | . |
9 | write STDIN; |
10 | |
9a7dcd9c |
11 | write() on closed filehandle %s [pp_leavewrite] |
599cee73 |
12 | format STDIN = |
13 | . |
14 | close STDIN; |
15 | write STDIN ; |
16 | |
767a6a26 |
17 | page overflow [pp_leavewrite] |
599cee73 |
18 | |
767a6a26 |
19 | Filehandle %s never opened [pp_prtf] |
599cee73 |
20 | $a = "abc"; printf $a "fred" |
21 | |
767a6a26 |
22 | Filehandle %s opened only for input [pp_prtf] |
599cee73 |
23 | $a = "abc"; |
24 | printf $a "fred" |
25 | |
9a7dcd9c |
26 | printf() on closed filehandle %s [pp_prtf] |
599cee73 |
27 | close STDIN ; |
28 | printf STDIN "fred" |
29 | |
69282e91 |
30 | syswrite() on closed filehandle %s [pp_send] |
599cee73 |
31 | close STDIN; |
32 | syswrite STDIN, "fred", 1; |
33 | |
69282e91 |
34 | send() on closed socket %s [pp_send] |
599cee73 |
35 | close STDIN; |
36 | send STDIN, "fred", 1 |
37 | |
69282e91 |
38 | bind() on closed socket %s [pp_bind] |
599cee73 |
39 | close STDIN; |
40 | bind STDIN, "fred" ; |
41 | |
42 | |
69282e91 |
43 | connect() on closed socket %s [pp_connect] |
599cee73 |
44 | close STDIN; |
45 | connect STDIN, "fred" ; |
46 | |
69282e91 |
47 | listen() on closed socket %s [pp_listen] |
599cee73 |
48 | close STDIN; |
49 | listen STDIN, 2; |
50 | |
69282e91 |
51 | accept() on closed socket %s [pp_accept] |
599cee73 |
52 | close STDIN; |
69282e91 |
53 | accept "fred", STDIN ; |
599cee73 |
54 | |
69282e91 |
55 | shutdown() on closed socket %s [pp_shutdown] |
599cee73 |
56 | close STDIN; |
57 | shutdown STDIN, 0; |
58 | |
69282e91 |
59 | setsockopt() on closed socket %s [pp_ssockopt] |
60 | getsockopt() on closed socket %s [pp_ssockopt] |
599cee73 |
61 | close STDIN; |
62 | setsockopt STDIN, 1,2,3; |
63 | getsockopt STDIN, 1,2; |
64 | |
69282e91 |
65 | getsockname() on closed socket %s [pp_getpeername] |
66 | getpeername() on closed socket %s [pp_getpeername] |
599cee73 |
67 | close STDIN; |
68 | getsockname STDIN; |
69 | getpeername STDIN; |
70 | |
69282e91 |
71 | flock() on closed socket %s [pp_flock] |
72 | close STDIN; |
73 | flock STDIN, 8; |
74 | |
767a6a26 |
75 | warn(warn_nl, "stat"); [pp_stat] |
599cee73 |
76 | |
77 | Test on unopened file <%s> |
78 | close STDIN ; -T STDIN ; |
79 | |
767a6a26 |
80 | warn(warn_nl, "open"); [pp_fttext] |
599cee73 |
81 | -T "abc\ndef" ; |
82 | |
767a6a26 |
83 | Filehandle %s opened only for output [pp_sysread] |
84 | my $file = "./xcv" ; |
85 | open(F, ">$file") ; |
86 | my $a = sysread(F, $a,10) ; |
87 | |
599cee73 |
88 | |
89 | |
90 | __END__ |
767a6a26 |
91 | # pp_sys.c [pp_untie] |
4438c4b7 |
92 | use warnings 'untie' ; |
599cee73 |
93 | sub TIESCALAR { bless [] } ; |
94 | $b = tie $a, 'main'; |
95 | untie $a ; |
4438c4b7 |
96 | no warnings 'untie' ; |
0453d815 |
97 | $c = tie $d, 'main'; |
98 | untie $d ; |
599cee73 |
99 | EXPECT |
100 | untie attempted while 1 inner references still exist at - line 5. |
101 | ######## |
767a6a26 |
102 | # pp_sys.c [pp_leavewrite] |
4438c4b7 |
103 | use warnings 'io' ; |
599cee73 |
104 | format STDIN = |
105 | . |
106 | write STDIN; |
4438c4b7 |
107 | no warnings 'io' ; |
0453d815 |
108 | write STDIN; |
599cee73 |
109 | EXPECT |
af8c498a |
110 | Filehandle main::STDIN opened only for input at - line 5. |
599cee73 |
111 | ######## |
767a6a26 |
112 | # pp_sys.c [pp_leavewrite] |
4438c4b7 |
113 | use warnings 'closed' ; |
599cee73 |
114 | format STDIN = |
115 | . |
116 | close STDIN; |
117 | write STDIN; |
69282e91 |
118 | opendir STDIN, "."; |
119 | write STDIN; |
120 | closedir STDIN; |
4438c4b7 |
121 | no warnings 'closed' ; |
0453d815 |
122 | write STDIN; |
69282e91 |
123 | opendir STDIN, "."; |
124 | write STDIN; |
599cee73 |
125 | EXPECT |
9a7dcd9c |
126 | write() on closed filehandle main::STDIN at - line 6. |
69282e91 |
127 | write() on closed filehandle main::STDIN at - line 8. |
128 | (Are you trying to call write() on dirhandle main::STDIN?) |
599cee73 |
129 | ######## |
767a6a26 |
130 | # pp_sys.c [pp_leavewrite] |
4438c4b7 |
131 | use warnings 'io' ; |
599cee73 |
132 | format STDOUT_TOP = |
133 | abc |
134 | . |
135 | format STDOUT = |
136 | def |
137 | ghi |
138 | . |
139 | $= = 1 ; |
140 | $- =1 ; |
3eeba6fb |
141 | open STDOUT, ">".($^O eq 'VMS'? 'NL:' : '/dev/null') ; |
599cee73 |
142 | write ; |
4438c4b7 |
143 | no warnings 'io' ; |
0453d815 |
144 | write ; |
599cee73 |
145 | EXPECT |
146 | page overflow at - line 13. |
147 | ######## |
767a6a26 |
148 | # pp_sys.c [pp_prtf] |
4438c4b7 |
149 | use warnings 'unopened' ; |
599cee73 |
150 | $a = "abc"; |
0453d815 |
151 | printf $a "fred"; |
4438c4b7 |
152 | no warnings 'unopened' ; |
0453d815 |
153 | printf $a "fred"; |
599cee73 |
154 | EXPECT |
155 | Filehandle main::abc never opened at - line 4. |
156 | ######## |
767a6a26 |
157 | # pp_sys.c [pp_prtf] |
4438c4b7 |
158 | use warnings 'closed' ; |
599cee73 |
159 | close STDIN ; |
0453d815 |
160 | printf STDIN "fred"; |
69282e91 |
161 | opendir STDIN, "."; |
162 | printf STDIN "fred"; |
163 | closedir STDIN; |
4438c4b7 |
164 | no warnings 'closed' ; |
0453d815 |
165 | printf STDIN "fred"; |
69282e91 |
166 | opendir STDIN, "."; |
167 | printf STDIN "fred"; |
599cee73 |
168 | EXPECT |
9a7dcd9c |
169 | printf() on closed filehandle main::STDIN at - line 4. |
69282e91 |
170 | printf() on closed filehandle main::STDIN at - line 6. |
171 | (Are you trying to call printf() on dirhandle main::STDIN?) |
599cee73 |
172 | ######## |
767a6a26 |
173 | # pp_sys.c [pp_prtf] |
4438c4b7 |
174 | use warnings 'io' ; |
0453d815 |
175 | printf STDIN "fred"; |
4438c4b7 |
176 | no warnings 'io' ; |
0453d815 |
177 | printf STDIN "fred"; |
599cee73 |
178 | EXPECT |
179 | Filehandle main::STDIN opened only for input at - line 3. |
180 | ######## |
767a6a26 |
181 | # pp_sys.c [pp_send] |
4438c4b7 |
182 | use warnings 'closed' ; |
599cee73 |
183 | close STDIN; |
184 | syswrite STDIN, "fred", 1; |
69282e91 |
185 | opendir STDIN, "."; |
186 | syswrite STDIN, "fred", 1; |
187 | closedir STDIN; |
4438c4b7 |
188 | no warnings 'closed' ; |
0453d815 |
189 | syswrite STDIN, "fred", 1; |
69282e91 |
190 | opendir STDIN, "."; |
191 | syswrite STDIN, "fred", 1; |
599cee73 |
192 | EXPECT |
69282e91 |
193 | syswrite() on closed filehandle main::STDIN at - line 4. |
194 | syswrite() on closed filehandle main::STDIN at - line 6. |
195 | (Are you trying to call syswrite() on dirhandle main::STDIN?) |
196 | ######## |
197 | # pp_sys.c [pp_flock] |
198 | use warnings 'closed' ; |
199 | close STDIN; |
200 | flock STDIN, 8; |
201 | opendir STDIN, "."; |
202 | flock STDIN, 8; |
203 | no warnings 'closed' ; |
204 | flock STDIN, 8; |
205 | opendir STDIN, "."; |
206 | flock STDIN, 8; |
207 | EXPECT |
208 | flock() on closed filehandle main::STDIN at - line 4. |
209 | flock() on closed filehandle main::STDIN at - line 6. |
210 | (Are you trying to call flock() on dirhandle main::STDIN?) |
599cee73 |
211 | ######## |
767a6a26 |
212 | # pp_sys.c [pp_prtf pp_send pp_bind pp_connect pp_listen pp_accept pp_shutdown pp_ssockopt ppp_getpeername] |
4438c4b7 |
213 | use warnings 'io' ; |
599cee73 |
214 | use Config; |
215 | BEGIN { |
216 | if ( $^O ne 'VMS' and ! $Config{d_socket}) { |
217 | print <<EOM ; |
218 | SKIPPED |
219 | # send not present |
220 | # bind not present |
221 | # connect not present |
222 | # accept not present |
223 | # shutdown not present |
224 | # setsockopt not present |
225 | # getsockopt not present |
226 | # getsockname not present |
227 | # getpeername not present |
228 | EOM |
229 | exit ; |
230 | } |
231 | } |
232 | close STDIN; |
233 | send STDIN, "fred", 1; |
234 | bind STDIN, "fred" ; |
235 | connect STDIN, "fred" ; |
236 | listen STDIN, 2; |
69282e91 |
237 | accept "fred", STDIN; |
238 | shutdown STDIN, 0; |
239 | setsockopt STDIN, 1,2,3; |
240 | getsockopt STDIN, 1,2; |
241 | getsockname STDIN; |
242 | getpeername STDIN; |
243 | opendir STDIN, "."; |
244 | send STDIN, "fred", 1; |
245 | bind STDIN, "fred" ; |
246 | connect STDIN, "fred" ; |
247 | listen STDIN, 2; |
248 | accept "fred", STDIN; |
599cee73 |
249 | shutdown STDIN, 0; |
250 | setsockopt STDIN, 1,2,3; |
251 | getsockopt STDIN, 1,2; |
252 | getsockname STDIN; |
253 | getpeername STDIN; |
69282e91 |
254 | closedir STDIN; |
4438c4b7 |
255 | no warnings 'io' ; |
0453d815 |
256 | send STDIN, "fred", 1; |
257 | bind STDIN, "fred" ; |
258 | connect STDIN, "fred" ; |
259 | listen STDIN, 2; |
260 | accept STDIN, "fred" ; |
261 | shutdown STDIN, 0; |
262 | setsockopt STDIN, 1,2,3; |
263 | getsockopt STDIN, 1,2; |
264 | getsockname STDIN; |
265 | getpeername STDIN; |
69282e91 |
266 | opendir STDIN, "."; |
267 | send STDIN, "fred", 1; |
268 | bind STDIN, "fred" ; |
269 | connect STDIN, "fred" ; |
270 | listen STDIN, 2; |
271 | accept "fred", STDIN; |
272 | shutdown STDIN, 0; |
273 | setsockopt STDIN, 1,2,3; |
274 | getsockopt STDIN, 1,2; |
275 | getsockname STDIN; |
276 | getpeername STDIN; |
599cee73 |
277 | EXPECT |
69282e91 |
278 | send() on closed socket main::STDIN at - line 22. |
279 | bind() on closed socket main::STDIN at - line 23. |
280 | connect() on closed socket main::STDIN at - line 24. |
281 | listen() on closed socket main::STDIN at - line 25. |
282 | accept() on closed socket main::STDIN at - line 26. |
283 | shutdown() on closed socket main::STDIN at - line 27. |
284 | setsockopt() on closed socket main::STDIN at - line 28. |
285 | getsockopt() on closed socket main::STDIN at - line 29. |
286 | getsockname() on closed socket main::STDIN at - line 30. |
287 | getpeername() on closed socket main::STDIN at - line 31. |
288 | send() on closed socket main::STDIN at - line 33. |
289 | (Are you trying to call send() on dirhandle main::STDIN?) |
290 | bind() on closed socket main::STDIN at - line 34. |
291 | (Are you trying to call bind() on dirhandle main::STDIN?) |
292 | connect() on closed socket main::STDIN at - line 35. |
293 | (Are you trying to call connect() on dirhandle main::STDIN?) |
294 | listen() on closed socket main::STDIN at - line 36. |
295 | (Are you trying to call listen() on dirhandle main::STDIN?) |
296 | accept() on closed socket main::STDIN at - line 37. |
297 | (Are you trying to call accept() on dirhandle main::STDIN?) |
298 | shutdown() on closed socket main::STDIN at - line 38. |
299 | (Are you trying to call shutdown() on dirhandle main::STDIN?) |
300 | setsockopt() on closed socket main::STDIN at - line 39. |
301 | (Are you trying to call setsockopt() on dirhandle main::STDIN?) |
302 | getsockopt() on closed socket main::STDIN at - line 40. |
303 | (Are you trying to call getsockopt() on dirhandle main::STDIN?) |
304 | getsockname() on closed socket main::STDIN at - line 41. |
305 | (Are you trying to call getsockname() on dirhandle main::STDIN?) |
306 | getpeername() on closed socket main::STDIN at - line 42. |
307 | (Are you trying to call getpeername() on dirhandle main::STDIN?) |
599cee73 |
308 | ######## |
767a6a26 |
309 | # pp_sys.c [pp_stat] |
4438c4b7 |
310 | use warnings 'newline' ; |
599cee73 |
311 | stat "abc\ndef"; |
4438c4b7 |
312 | no warnings 'newline' ; |
0453d815 |
313 | stat "abc\ndef"; |
599cee73 |
314 | EXPECT |
315 | Unsuccessful stat on filename containing newline at - line 3. |
316 | ######## |
767a6a26 |
317 | # pp_sys.c [pp_fttext] |
4438c4b7 |
318 | use warnings 'unopened' ; |
599cee73 |
319 | close STDIN ; |
320 | -T STDIN ; |
4438c4b7 |
321 | no warnings 'unopened' ; |
0453d815 |
322 | -T STDIN ; |
599cee73 |
323 | EXPECT |
324 | Test on unopened file <STDIN> at - line 4. |
325 | ######## |
767a6a26 |
326 | # pp_sys.c [pp_fttext] |
4438c4b7 |
327 | use warnings 'newline' ; |
599cee73 |
328 | -T "abc\ndef" ; |
4438c4b7 |
329 | no warnings 'newline' ; |
0453d815 |
330 | -T "abc\ndef" ; |
599cee73 |
331 | EXPECT |
332 | Unsuccessful open on filename containing newline at - line 3. |
767a6a26 |
333 | ######## |
334 | # pp_sys.c [pp_sysread] |
335 | use warnings 'io' ; |
336 | my $file = "./xcv" ; |
337 | open(F, ">$file") ; |
338 | my $a = sysread(F, $a,10) ; |
339 | no warnings 'io' ; |
340 | my $a = sysread(F, $a,10) ; |
341 | close F ; |
342 | unlink $file ; |
343 | EXPECT |
344 | Filehandle main::F opened only for output at - line 5. |