7016
|
1 ## Copyright (C) 2007 John W. Eaton |
|
2 ## |
|
3 ## This file is part of Octave. |
|
4 ## |
|
5 ## Octave is free software; you can redistribute it and/or modify it |
|
6 ## under the terms of the GNU General Public License as published by |
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
|
8 ## your option) any later version. |
|
9 ## |
|
10 ## Octave is distributed in the hope that it will be useful, but |
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 ## General Public License for more details. |
|
14 ## |
|
15 ## You should have received a copy of the GNU General Public License |
|
16 ## along with Octave; see the file COPYING. If not, see |
|
17 ## <http://www.gnu.org/licenses/>. |
|
18 |
5590
|
19 %% Automatically generated from DejaGNU files |
|
20 |
|
21 %% test/octave.test/system/time-1.m |
|
22 %!assert(time () > 0); |
|
23 |
|
24 %% test/octave.test/system/ctime-1.m |
|
25 %!test |
|
26 %! t = time (); |
|
27 %! assert(strcmp (asctime (localtime (t)), ctime (t))); |
|
28 |
|
29 %% test/octave.test/system/ctime-2.m |
|
30 %!error ctime (); |
|
31 |
|
32 %% test/octave.test/system/ctime-3.m |
|
33 %!error ctime (1, 2); |
|
34 |
|
35 %% test/octave.test/system/gmtime-1.m |
|
36 %!test |
|
37 %! ts = gmtime (time ()); |
|
38 %! assert((isstruct (ts) |
|
39 %! && struct_contains (ts, "usec") |
|
40 %! && struct_contains (ts, "year") |
|
41 %! && struct_contains (ts, "mon") |
|
42 %! && struct_contains (ts, "mday") |
|
43 %! && struct_contains (ts, "sec") |
|
44 %! && struct_contains (ts, "min") |
|
45 %! && struct_contains (ts, "wday") |
|
46 %! && struct_contains (ts, "hour") |
|
47 %! && struct_contains (ts, "isdst") |
|
48 %! && struct_contains (ts, "yday"))); |
|
49 |
|
50 %% test/octave.test/system/gmtime-2.m |
5751
|
51 %!error <Invalid call to gmtime.*> gmtime (); |
5590
|
52 |
|
53 %% test/octave.test/system/gmtime-3.m |
5751
|
54 %!error <Invalid call to gmtime.*> gmtime (1, 2); |
5590
|
55 |
|
56 %% test/octave.test/system/localtime-1.m |
|
57 %!test |
|
58 %! ts = localtime (time ()); |
|
59 %! assert((isstruct (ts) |
|
60 %! && struct_contains (ts, "usec") |
|
61 %! && struct_contains (ts, "year") |
|
62 %! && struct_contains (ts, "mon") |
|
63 %! && struct_contains (ts, "mday") |
|
64 %! && struct_contains (ts, "sec") |
|
65 %! && struct_contains (ts, "min") |
|
66 %! && struct_contains (ts, "wday") |
|
67 %! && struct_contains (ts, "hour") |
|
68 %! && struct_contains (ts, "isdst") |
|
69 %! && struct_contains (ts, "yday"))); |
|
70 |
|
71 %% test/octave.test/system/localtime-2.m |
5751
|
72 %!error <Invalid call to localtime.*> localtime (); |
5590
|
73 |
|
74 %% test/octave.test/system/localtime-3.m |
5751
|
75 %!error <Invalid call to localtime.*> localtime (1, 2); |
5590
|
76 |
|
77 %% test/octave.test/system/mktime-1.m |
|
78 %!test |
|
79 %! t = time (); |
|
80 %! assert(fix (mktime (localtime (t))) == fix (t)); |
|
81 |
|
82 %% test/octave.test/system/mktime-2.m |
5751
|
83 %!error <Invalid call to mktime.*> mktime (); |
5590
|
84 |
|
85 %% test/octave.test/system/mktime-3.m |
5751
|
86 %!error <Invalid call to mktime.*> mktime (1, 2, 3); |
5590
|
87 |
|
88 %% test/octave.test/system/asctime-1.m |
|
89 %!test |
|
90 %! t = time (); |
|
91 %! assert(strcmp (asctime (localtime (t)), ctime (t))); |
|
92 |
|
93 %% test/octave.test/system/asctime-2.m |
|
94 %!error asctime (); |
|
95 |
|
96 %% test/octave.test/system/asctime-3.m |
|
97 %!error asctime (1, 2); |
|
98 |
|
99 %% test/octave.test/system/strftime-1.m |
|
100 %!assert((isstr (strftime ("%%%n%t%H%I%k%l", localtime (time ()))) |
|
101 %! && isstr (strftime ("%M%p%r%R%s%S%T", localtime (time ()))) |
|
102 %! && isstr (strftime ("%X%Z%z%a%A%b%B", localtime (time ()))) |
|
103 %! && isstr (strftime ("%c%C%d%e%D%h%j", localtime (time ()))) |
|
104 %! && isstr (strftime ("%m%U%w%W%x%y%Y", localtime (time ()))))); |
|
105 |
|
106 %% test/octave.test/system/strftime-2.m |
5751
|
107 %!error <Invalid call to strftime.*> strftime (); |
5590
|
108 |
|
109 %% test/octave.test/system/strftime-3.m |
5751
|
110 %!error <Invalid call to strftime.*> strftime ("foo", localtime (time ()), 1); |
5590
|
111 |
|
112 %% test/octave.test/system/clock-1.m |
|
113 %!test |
|
114 %! t1 = clock; |
|
115 %! t2 = str2num (strftime ("[%Y, %m, %d, %H, %M, %S]", localtime (time ()))); |
|
116 %! assert(etime (t1, t2) < 1); |
|
117 |
|
118 %% test/octave.test/system/date-1.m |
|
119 %!assert(strcmp (date (), strftime ("%d-%b-%Y", localtime (time ())))); |
|
120 |
|
121 %% test/octave.test/system/etime-1.m |
|
122 %!test |
|
123 %! t1 = [1993, 8, 20, 4, 56, 1]; |
|
124 %! t2 = [1993, 8, 21, 4, 56, 1]; |
|
125 %! t3 = [1993, 8, 20, 5, 56, 1]; |
|
126 %! t4 = [1993, 8, 20, 4, 57, 1]; |
|
127 %! t5 = [1993, 8, 20, 4, 56, 14]; |
|
128 %! |
|
129 %! assert((etime (t2, t1) == 86400 && etime (t3, t1) == 3600 |
|
130 %! && etime (t4, t1) == 60 && etime (t5, t1) == 13)); |
|
131 |
|
132 %% test/octave.test/system/etime-2.m |
|
133 %!error etime (); |
|
134 |
|
135 %% test/octave.test/system/etime-3.m |
|
136 %!error etime (1, 2, 3); |
|
137 |
|
138 %% test/octave.test/system/cputime-1.m |
|
139 %!test |
|
140 %! [t1, u1, s1] = cputime (); |
|
141 %! for i = 1:200 |
|
142 %! sin (i); |
|
143 %! endfor |
|
144 %! [t2, u2, s2] = cputime (); |
|
145 %! assert(t1 == u1 + s1 && t2 == u2 + s2 && t2 >= t1 && u2 >= u2 && s2 >= s2); |
|
146 |
|
147 %% test/octave.test/system/is_leap_year-1.m |
|
148 %!assert((is_leap_year (2000) == 1 && is_leap_year (1976) == 1 |
|
149 %! && is_leap_year (1000) == 0 && is_leap_year (1800) == 0 |
|
150 %! && is_leap_year (1600) == 1)); |
|
151 |
|
152 %% test/octave.test/system/is_leap_year-2.m |
|
153 %!error is_leap_year (1, 2); |
|
154 |
|
155 %% test/octave.test/system/tic-toc-1.m |
|
156 %!test |
|
157 %! tic (); |
|
158 %! sleep (2); |
|
159 %! assert(toc () > 0); |
|
160 |
|
161 %% test/octave.test/system/pause-1.m |
|
162 %!test |
|
163 %! pause (0); |
|
164 %! printf_assert ("ok\n"); |
|
165 %! assert(prog_output_assert("ok")); |
|
166 |
|
167 %% test/octave.test/system/pause-2.m |
5751
|
168 %!error <Invalid call to pause.*> pause (1, 2); |
5590
|
169 |
|
170 %% test/octave.test/system/sleep-1.m |
|
171 %!test |
|
172 %! sleep (0); |
|
173 %! printf_assert ("ok\n"); |
|
174 %! assert(prog_output_assert("ok")); |
|
175 |
|
176 %% test/octave.test/system/sleep-2.m |
5751
|
177 %!error <Invalid call to sleep.*> sleep (); |
5590
|
178 |
|
179 %% test/octave.test/system/sleep-3.m |
5751
|
180 %!error <Invalid call to sleep.*> sleep (1, 2); |
5590
|
181 |
|
182 %% test/octave.test/system/usleep-1.m |
|
183 %!test |
|
184 %! usleep (0); |
|
185 %! printf_assert ("ok\n"); |
|
186 %! assert(prog_output_assert("ok")); |
|
187 |
|
188 %% test/octave.test/system/usleep-2.m |
5751
|
189 %!error <Invalid call to usleep.*> usleep (); |
5590
|
190 |
|
191 %% test/octave.test/system/usleep-3.m |
5751
|
192 %!error <Invalid call to usleep.*> usleep (1, 2); |
5590
|
193 |
|
194 %% test/octave.test/system/rename-1.m |
|
195 %!test |
|
196 %! from = tmpnam (); |
|
197 %! to = tmpnam (); |
|
198 %! id = fopen (from, "wb"); |
|
199 %! if (id > 0 && fclose (id) == 0) |
|
200 %! [s, e] = stat (from); |
|
201 %! if (! e) |
|
202 %! if (rename (from, to) == 0) |
|
203 %! [s, e] = stat (from); |
|
204 %! if (e < 0) |
|
205 %! [s, e] = stat (to); |
|
206 %! assert(e == 0); |
|
207 %! unlink (to); |
|
208 %! endif |
|
209 %! endif |
|
210 %! endif |
|
211 %! endif |
|
212 |
|
213 %% test/octave.test/system/rename-2.m |
5751
|
214 %!error <Invalid call to rename.*> rename (); |
5590
|
215 |
|
216 %% test/octave.test/system/rename-3.m |
5751
|
217 %!error <Invalid call to rename.*> rename ("foo", "bar", 1); |
5590
|
218 |
|
219 %% test/octave.test/system/unlink-1.m |
|
220 %!test |
|
221 %! nm = tmpnam (); |
|
222 %! if ((id = fopen (nm, "wb")) > 0) |
|
223 %! [s, err] = stat (nm); |
|
224 %! if (! err && fclose (id) == 0 && unlink (nm) == 0) |
|
225 %! [s, err] = stat (nm); |
|
226 %! assert(err < 0); |
|
227 %! endif |
|
228 %! endif |
|
229 |
|
230 %% test/octave.test/system/unlink-2.m |
5751
|
231 %!error <Invalid call to unlink.*> unlink (); |
5590
|
232 |
|
233 %% test/octave.test/system/unlink-3.m |
5751
|
234 %!error <Invalid call to unlink.*> unlink ("foo", 1); |
5590
|
235 |
|
236 %% test/octave.test/system/readdir-1.m |
|
237 %!test |
5595
|
238 %! [files, status, msg] = readdir (filesep); |
6456
|
239 %! assert(iscell (files) && status == 0 && strcmp (msg, "")); |
5590
|
240 |
|
241 %% test/octave.test/system/readdir-2.m |
5751
|
242 %!error <Invalid call to readdir.*> readdir (); |
5590
|
243 |
|
244 %% test/octave.test/system/readdir-3.m |
5751
|
245 %!error <Invalid call to readdir.*> readdir ("foo", 1); |
5590
|
246 |
|
247 %% test/octave.test/system/mk-rm-dir-1.m |
|
248 %!test |
|
249 %! nm = tmpnam (); |
|
250 %! e1 = mkdir (nm); |
|
251 %! [s2, e2] = stat (nm); |
|
252 %! e3 = rmdir (nm); |
|
253 %! [s4, e4] = stat (nm); |
|
254 %! assert((e1 && strcmp (s2.modestr(1), "d") && e3 && e4 < 0)); |
|
255 |
|
256 %% test/octave.test/system/mkdir-1.m |
5751
|
257 %!error <Invalid call to mkdir.*> mkdir (); |
5590
|
258 |
|
259 %% test/octave.test/system/mkdir-2.m |
6200
|
260 %!error <Invalid call to mkdir.*> mkdir ("foo", 1, 2); |
5590
|
261 |
|
262 %% test/octave.test/system/rmdir-1.m |
5751
|
263 %!error <Invalid call to rmdir.*> rmdir (); |
5590
|
264 |
|
265 %% test/octave.test/system/rmdir-2.m |
5648
|
266 %!test |
6327
|
267 %! crr = confirm_recursive_rmdir (); |
|
268 %! confirm_recursive_rmdir (0); |
5648
|
269 %! assert(!rmdir ("foo", "s")); |
6327
|
270 %! confirm_recursive_rmdir (crr); |
5590
|
271 |
5775
|
272 %% FIXME This test messes up the path it seems!! Why? |
5590
|
273 %% test/octave.test/system/umask-1.m |
|
274 %!#test |
|
275 %! umask (0); |
|
276 %! nm = tmpnam (); |
|
277 %! id = fopen (nm, "wb"); |
|
278 %! s1 = stat (nm); |
|
279 %! fclose (id); |
|
280 %! unlink (nm); |
|
281 %! |
|
282 %! umask (777); |
|
283 %! nm = tmpnam (); |
|
284 %! id = fopen (nm, "wb"); |
|
285 %! s2 = stat (nm); |
|
286 %! fclose (id); |
|
287 %! unlink (nm); |
|
288 %! |
|
289 %! assert(strcmp (s1.modestr, "-rw-rw-rw-") && strcmp (s2.modestr, "----------")); |
|
290 |
|
291 %% test/octave.test/system/umask-2.m |
5751
|
292 %!error <Invalid call to umask.*> umask (); |
5590
|
293 |
|
294 %% test/octave.test/system/umask-3.m |
5751
|
295 %!error <Invalid call to umask.*> umask (1, 2); |
5590
|
296 |
|
297 %% test/octave.test/system/stat-1.m |
|
298 %!test |
5595
|
299 %! [s, err, msg] = stat (filesep); |
5590
|
300 %! assert((err == 0 |
|
301 %! && isstruct (s) |
|
302 %! && struct_contains (s, "dev") |
|
303 %! && struct_contains (s, "ino") |
|
304 %! && struct_contains (s, "modestr") |
|
305 %! && struct_contains (s, "nlink") |
|
306 %! && struct_contains (s, "uid") |
|
307 %! && struct_contains (s, "gid") |
|
308 %! && struct_contains (s, "size") |
|
309 %! && struct_contains (s, "atime") |
|
310 %! && struct_contains (s, "mtime") |
|
311 %! && struct_contains (s, "ctime") |
|
312 %! && isstr (msg))); |
|
313 |
|
314 %% test/octave.test/system/stat-2.m |
5751
|
315 %!error <Invalid call to stat.*> stat (); |
5590
|
316 |
|
317 %% test/octave.test/system/stat-3.m |
5751
|
318 %!error <Invalid call to stat.*> stat ("foo", 1); |
5590
|
319 |
|
320 %% test/octave.test/system/lstat-1.m |
|
321 %!test |
5595
|
322 %! [s, err, msg] = lstat (filesep); |
5590
|
323 %! assert((err == 0 |
|
324 %! && isstruct (s) |
|
325 %! && struct_contains (s, "dev") |
|
326 %! && struct_contains (s, "ino") |
|
327 %! && struct_contains (s, "modestr") |
|
328 %! && struct_contains (s, "nlink") |
|
329 %! && struct_contains (s, "uid") |
|
330 %! && struct_contains (s, "gid") |
|
331 %! && struct_contains (s, "size") |
|
332 %! && struct_contains (s, "atime") |
|
333 %! && struct_contains (s, "mtime") |
|
334 %! && struct_contains (s, "ctime") |
|
335 %! && isstr (msg))); |
|
336 |
|
337 %% test/octave.test/system/lstat-2.m |
5751
|
338 %!error <Invalid call to lstat.*> lstat (); |
5590
|
339 |
|
340 %% test/octave.test/system/lstat-3.m |
5751
|
341 %!error <Invalid call to lstat.*> lstat ("foo", 1); |
5590
|
342 |
|
343 %% test/octave.test/system/glob-1.m |
5595
|
344 %!assert(iscell (glob ([filesep "*"]))); |
5590
|
345 |
|
346 %% test/octave.test/system/glob-2.m |
5751
|
347 %!error <Invalid call to glob*> glob (); |
5590
|
348 |
|
349 %% test/octave.test/system/glob-3.m |
5751
|
350 %!error <Invalid call to glob.*> glob ("foo", 1); |
5590
|
351 |
|
352 %% test/octave.test/system/fnmatch-1.m |
|
353 %!test |
|
354 %! string_fill_char = setstr (0); |
5707
|
355 %! assert((fnmatch ("a*a", {"aba"; "xxxba"; "aa"}) == [1; 0; 1] |
|
356 %! && fnmatch ({"a*a"; "b*b"}, "bob") |
|
357 %! && fnmatch ("x[0-5]*", {"x1"; "x6"}) == [1; 0] |
|
358 %! && fnmatch ("x[0-5]*", {"x1"; "x6"; "x001"}) == [1; 0; 1] |
|
359 %! && fnmatch ("x???y", {"xabcy"; "xy"}) == [1; 0])); |
5590
|
360 |
|
361 %% test/octave.test/system/fnmatch-2.m |
5751
|
362 %!error <Invalid call to fnmatch.*> fnmatch (); |
5590
|
363 |
|
364 %% test/octave.test/system/fnmatch-3.m |
5751
|
365 %!error <Invalid call to fnmatch.*> fnmatch ("foo", "bar", 3); |
5590
|
366 |
|
367 %% test/octave.test/system/file_in_path-1.m |
5814
|
368 %!assert(isstr (file_in_path (path (), "date.m"))); |
5590
|
369 |
|
370 %% test/octave.test/system/file_in_path-2.m |
|
371 %!error <invalid option> file_in_path ("foo", "bar", 1); |
|
372 |
|
373 %% test/octave.test/system/file_in_path-3.m |
5751
|
374 %!error <Invalid call to file_in_path.*> file_in_path (); |
5590
|
375 |
|
376 %% test/octave.test/system/file_in_path-4.m |
5751
|
377 %!error <Invalid call to file_in_path.*> file_in_path ("foo", "bar", "baz", "ooka"); |
5590
|
378 |
|
379 %% test/octave.test/system/tilde_expand-1.m |
|
380 %!test |
|
381 %! x = getpwuid (getuid ()); |
|
382 %! assert((strcmp (x.dir, tilde_expand ("~")) |
|
383 %! && strcmp (x.dir, tilde_expand (sprintf ("~%s", x.name))) |
|
384 %! && strcmp ("foobar", tilde_expand ("foobar")))); |
|
385 |
|
386 %% test/octave.test/system/tilde_expand-2.m |
5751
|
387 %!error <Invalid call to tilde_expand.*> tilde_expand (); |
5590
|
388 |
|
389 %% test/octave.test/system/tilde_expand-3.m |
5751
|
390 %!error <Invalid call to tilde_expand.*> tilde_expand ("str", 2); |
5590
|
391 |
|
392 %% test/octave.test/system/getpgrp-1.m |
|
393 %!assert(getpgrp () > 0); |
|
394 |
|
395 %% test/octave.test/system/getpgrp-2.m |
|
396 %!error <... getpgrp> getpgrp (1); |
|
397 |
|
398 %% test/octave.test/system/getpid-1.m |
|
399 %!assert(getpid () > 0); |
|
400 |
|
401 %% test/octave.test/system/getpid-2.m |
|
402 %!error <... getpid> getpid (1); |
|
403 |
|
404 %% test/octave.test/system/getppid-1.m |
|
405 %!assert(getppid () > 0); |
|
406 |
|
407 %% test/octave.test/system/getppid-2.m |
|
408 %!error <... getppid> getppid (1); |
|
409 |
|
410 %% test/octave.test/system/geteuid-1.m |
|
411 %!assert(geteuid () >= 0); |
|
412 |
|
413 %% test/octave.test/system/geteuid-2.m |
|
414 %!error <... geteuid> geteuid (1); |
|
415 |
|
416 %% test/octave.test/system/getuid-1.m |
|
417 %!assert(getuid () >= 0); |
|
418 |
|
419 %% test/octave.test/system/getuid-2.m |
|
420 %!error <... getuid> getuid (1); |
|
421 |
|
422 %% test/octave.test/system/getegid-1.m |
|
423 %!assert(getegid () >= 0); |
|
424 |
|
425 %% test/octave.test/system/getegid-2.m |
|
426 %!error <... getegid> getegid (1); |
|
427 |
|
428 %% test/octave.test/system/getgid-1.m |
|
429 %!assert(getgid () >= 0); |
|
430 |
|
431 %% test/octave.test/system/getgid-2.m |
|
432 %!error <... getgid> getgid (1); |
|
433 |
|
434 %% test/octave.test/system/getenv-1.m |
|
435 %!assert(strcmp (getenv ("HOME"), tilde_expand ("~"))); |
|
436 |
|
437 %% test/octave.test/system/getenv-2.m |
5751
|
438 %!error <Invalid call to getenv.*> getenv (); |
5590
|
439 |
|
440 %% test/octave.test/system/getenv-3.m |
5751
|
441 %!error <Invalid call to getenv.*> getenv ("foo", 1); |
5590
|
442 |
|
443 %% test/octave.test/system/getenv-4.m |
|
444 %!test |
5781
|
445 %! wns = warning ("query", "Octave:num-to-str"); |
|
446 %! warning ("on", "Octave:num-to-str"); |
5590
|
447 %! fail("getenv (1)","warning"); |
5781
|
448 %! warning (wns.state, "Octave:num-to-str"); |
5590
|
449 |
|
450 %% test/octave.test/system/putenv-1.m |
|
451 %!test |
|
452 %! putenv ("foobar", "baz"); |
|
453 %! assert(strcmp (getenv ("foobar"), "baz")); |
|
454 |
|
455 %% test/octave.test/system/putenv-2.m |
5751
|
456 %!error <Invalid call to putenv.*> putenv (); |
5590
|
457 |
|
458 %% test/octave.test/system/putenv-3.m |
5751
|
459 %!error <Invalid call to putenv.*> putenv ("foo", "bar", 1); |
5590
|
460 |
|
461 %% test/octave.test/system/putenv-4.m |
|
462 %!test |
5781
|
463 %! wns = warning ("query", "Octave:num-to-str"); |
|
464 %! warning ("on", "Octave:num-to-str"); |
5590
|
465 %! fail("putenv (1, 2)","warning"); |
5781
|
466 %! warning (wns.state, "Octave:num-to-str"); |
5590
|
467 |
|
468 %% test/octave.test/system/cd-1.m |
|
469 %!test |
|
470 %! xdir = pwd (); |
|
471 %! cd / |
|
472 %! d1 = pwd (); |
|
473 %! cd (xdir); |
|
474 %! assert("/", d1); |
|
475 %! assert(pwd(), xdir); |
|
476 |
|
477 %% test/octave.test/system/cd-2.m |
|
478 %!error cd (1); |
|
479 |
|
480 %% test/octave.test/system/pwd-1.m |
|
481 %!assert(isstr (pwd ())); |
|
482 |
|
483 %% test/octave.test/system/ls-1.m |
|
484 %!error ls (1); |
|
485 |
|
486 %% test/octave.test/system/getpwent-1.m |
|
487 %!test |
|
488 %! s = getpwent (); |
5678
|
489 %! endpwent (); |
5590
|
490 %! assert((isstruct (s) |
|
491 %! && struct_contains (s, "name") |
|
492 %! && struct_contains (s, "passwd") |
|
493 %! && struct_contains (s, "uid") |
|
494 %! && struct_contains (s, "gid") |
|
495 %! && struct_contains (s, "gecos") |
|
496 %! && struct_contains (s, "dir") |
|
497 %! && struct_contains (s, "shell"))); |
|
498 |
|
499 %% test/octave.test/system/getpwent-2.m |
5751
|
500 %!error <Invalid call to getpwent.*> getpwent (1); |
5590
|
501 |
|
502 %% test/octave.test/system/getpwuid-1.m |
|
503 %!test |
|
504 %! x = getpwent (); |
|
505 %! y = getpwuid (x.uid); |
5678
|
506 %! endpwent (); |
5590
|
507 %! assert(strcmp (x.name, y.name) && x.uid == y.uid && x.gid == y.gid); |
|
508 |
|
509 %% test/octave.test/system/getpwuid-2.m |
5751
|
510 %!error <Invalid call to getpwuid.*> getpwuid (); |
5590
|
511 |
|
512 %% test/octave.test/system/getpwuid-3.m |
5751
|
513 %!error <Invalid call to getpwuid.*> getpwuid (1, 2); |
5590
|
514 |
|
515 %% test/octave.test/system/getpwnam-1.m |
|
516 %!test |
|
517 %! x = getpwent (); |
|
518 %! y = getpwnam (x.name); |
5678
|
519 %! endpwent (); |
5590
|
520 %! assert(strcmp (x.name, y.name) && x.uid == y.uid && x.gid == y.gid); |
|
521 |
|
522 %% test/octave.test/system/getpwnam-2.m |
5751
|
523 %!error <Invalid call to getpwnam.*> getpwnam (); |
5590
|
524 |
|
525 %% test/octave.test/system/getpwnam-3.m |
5751
|
526 %!error <Invalid call to getpwnam.*> getpwnam ("foo", 1); |
5590
|
527 |
|
528 %% test/octave.test/system/setpwent-1.m |
|
529 %!test |
|
530 %! x = getpwent (); |
|
531 %! setpwent (); |
|
532 %! y = getpwent (); |
5678
|
533 %! endpwent (); |
5590
|
534 %! assert(strcmp (x.name, y.name) && x.uid == y.uid && x.gid == y.gid); |
|
535 |
|
536 %% test/octave.test/system/setpwent-2.m |
5751
|
537 %!error <Invalid call to setpwent.*> setpwent (1); |
5590
|
538 |
|
539 %% test/octave.test/system/endpwent-1.m |
5751
|
540 %!error <Invalid call to endpwent.*> endpwent (1); |
5590
|
541 |
|
542 %% test/octave.test/system/getgrent-1.m |
|
543 %!test |
|
544 %! x = getgrent (); |
5678
|
545 %! endgrent (); |
5590
|
546 %! assert((isstruct (x) |
|
547 %! && struct_contains (x, "name") |
|
548 %! && struct_contains (x, "passwd") |
|
549 %! && struct_contains (x, "gid") |
|
550 %! && struct_contains (x, "mem"))); |
|
551 |
|
552 %% test/octave.test/system/getgrent-2.m |
5751
|
553 %!error <Invalid call to getgrent.*> getgrent (1); |
5590
|
554 |
|
555 %% test/octave.test/system/getgrgid-1.m |
|
556 %!test |
|
557 %! x = getgrent (); |
|
558 %! y = getgrgid (x.gid); |
5678
|
559 %! endgrent (); |
5590
|
560 %! assert(strcmp (x.name, y.name) && x.gid == y.gid); |
|
561 |
|
562 %% test/octave.test/system/getgrgid-2.m |
5751
|
563 %!error <Invalid call to getgrgid.*> getgrgid (); |
5590
|
564 |
|
565 %% test/octave.test/system/getgrgid-3.m |
5751
|
566 %!error <Invalid call to getgrgid.*> getgrgid (1, 2); |
5590
|
567 |
|
568 %% test/octave.test/system/getgrnam-1.m |
|
569 %!test |
|
570 %! x = getgrent (); |
|
571 %! y = getgrnam (x.name); |
5678
|
572 %! endgrent (); |
5590
|
573 %! assert(strcmp (x.name, y.name) && x.gid == y.gid); |
|
574 |
|
575 %% test/octave.test/system/getgrnam-2.m |
5751
|
576 %!error <Invalid call to getgrnam.*> getgrnam (); |
5590
|
577 |
|
578 %% test/octave.test/system/getgrnam-3.m |
5751
|
579 %!error <Invalid call to getgrnam.*> getgrnam ("foo", 1); |
5590
|
580 |
|
581 %% test/octave.test/system/setgrent-1.m |
|
582 %!test |
|
583 %! x = getgrent (); |
|
584 %! setgrent (); |
|
585 %! y = getgrent (); |
5678
|
586 %! endgrent (); |
5590
|
587 %! assert(strcmp (x.name, y.name) && x.gid == y.gid); |
|
588 |
|
589 %% test/octave.test/system/setgrent-2.m |
5751
|
590 %!error <Invalid call to setgrent.*> setgrent (1); |
5590
|
591 |
|
592 %% test/octave.test/system/endgrent-1.m |
5751
|
593 %!error <Invalid call to endgrent.*> endgrent (1); |
5590
|
594 |
|
595 %% test/octave.test/system/computer-1.m |
|
596 %!assert((isstr (computer ()) |
|
597 %! && computer () == octave_config_info ("canonical_host_type"))); |
|
598 |
|
599 %% test/octave.test/system/computer-2.m |
|
600 %!warning a =computer(2); |
|
601 |
|
602 %% test/octave.test/system/isieee-1.m |
|
603 %!assert(isieee () == 1 || isieee () == 0); |
|
604 |
|
605 %% test/octave.test/system/version-1.m |
|
606 %!assert(isstr (version ()) && strcmp (version (), OCTAVE_VERSION)); |
|
607 |
|
608 %% test/octave.test/system/version-2.m |
|
609 %!warning version (1); |
|
610 |
|
611 %% test/octave.test/system/octave_config_info-1.m |
|
612 %!assert(isstruct (octave_config_info ())); |
|
613 |
|
614 %% test/octave.test/system/getrusage-1.m |
|
615 %!assert(isstruct (getrusage ())); |
|
616 |