Mercurial > hg > octave-terminal
changeset 12827:8c6d71520920
codesprint: new tests for sysdep.cc functions
* sysdep.cc (FSIG, Fdebug_on_interrupt, Fsighup_dumps_octave_core,
Fsigterm_dumps_octave_core): New tests.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 16 Jul 2011 17:09:32 -0400 |
parents | 56bc9eda5c9c |
children | 0bf51abcf759 |
files | src/sighandlers.cc |
diffstat | 1 files changed, 33 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/sighandlers.cc +++ b/src/sighandlers.cc @@ -945,6 +945,12 @@ return retval; } +/* +%!error SIG (1); +%!assert (isstruct (SIG ())); +%!assert (! isempty (SIG ())); +*/ + DEFUN (debug_on_interrupt, args, nargout, "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} debug_on_interrupt ()\n\ @@ -958,6 +964,15 @@ return SET_INTERNAL_VARIABLE (debug_on_interrupt); } +/* +%!error (debug_on_interrupt (1, 2)); +%!test +%! old_val = debug_on_interrupt (false); +%! debug_on_interrupt (true); +%! assert (debug_on_interrupt (true)); +%! debug_on_interrupt (old_val); +*/ + DEFUN (sighup_dumps_octave_core, args, nargout, "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} sighup_dumps_octave_core ()\n\ @@ -970,6 +985,15 @@ return SET_INTERNAL_VARIABLE (sighup_dumps_octave_core); } +/* +%!error (sighup_dumps_octave_core (1, 2)); +%!test +%! old_val = sighup_dumps_octave_core (false); +%! sighup_dumps_octave_core (true); +%! assert (sighup_dumps_octave_core (true)); +%! sighup_dumps_octave_core (old_val); +*/ + DEFUN (sigterm_dumps_octave_core, args, nargout, "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} sigterm_dumps_octave_core ()\n\ @@ -981,3 +1005,12 @@ { return SET_INTERNAL_VARIABLE (sigterm_dumps_octave_core); } + +/* +%!error (sigterm_dumps_octave_core (1, 2)); +%!test +%! old_val = sigterm_dumps_octave_core (false); +%! sigterm_dumps_octave_core (true); +%! assert (sigterm_dumps_octave_core (true)); +%! sigterm_dumps_octave_core (old_val); +*/