Mercurial > jwe > octave
changeset 27043:8c4f01b66c0b stable
Add BIST tests for unlink() (bug #56097).
* syscalls.cc (Funlink): Add BIST tests.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 11 Apr 2019 08:37:13 -0700 |
parents | 32d9f57d7245 |
children | 6caf75200854 |
files | libinterp/corefcn/syscalls.cc |
diffstat | 1 files changed, 19 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/syscalls.cc Wed Apr 10 23:53:01 2019 +0200 +++ b/libinterp/corefcn/syscalls.cc Thu Apr 11 08:37:13 2019 -0700 @@ -1099,6 +1099,25 @@ return ovl (status, msg); } +/* +%!test +%! file = tempname (); +%! fid = fopen (file, "wt"); +%! if (fid < 0) +%! error ("Could not open temporary file for unlink BIST test"); +%! endif +%! fdisp (fid, pi); +%! fclose (fid); +%! [err, msg] = unlink (file); +%! assert (err, 0); +%! assert (msg, ""); + +## Test input validation +%!error unlink () +%!error unlink ("a", "b") +%!error <FILE must be a string> unlink (123) +*/ + DEFUNX ("waitpid", Fwaitpid, args, , doc: /* -*- texinfo -*- @deftypefn {} {[@var{pid}, @var{status}, @var{msg}] =} waitpid (@var{pid}, @var{options})