Mercurial > hg > octave-lyh
changeset 12832:03f125c0fb7b
codesprint: improve tests
* sighandlers.cc (Fdebug_on_interrupt, Fsighup_dumps_octave_core,
Fsigterm_dumps_octave_core): Improve tests.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 16 Jul 2011 17:24:02 -0400 |
parents | 05a6e27d7908 |
children | 9f0f2c226053 |
files | src/sighandlers.cc |
diffstat | 1 files changed, 18 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/sighandlers.cc +++ b/src/sighandlers.cc @@ -967,10 +967,12 @@ /* %!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); +%! orig_val = debug_on_interrupt (); +%! old_val = debug_on_interrupt (! orig_val); +%! assert (orig_val, old_val); +%! assert (debug_on_interrupt (), ! orig_val); +%! debug_on_interrupt (orig_val); +%! assert (debug_on_interrupt (), orig_val); */ DEFUN (sighup_dumps_octave_core, args, nargout, @@ -988,10 +990,12 @@ /* %!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); +%! orig_val = sighup_dumps_octave_core (); +%! old_val = sighup_dumps_octave_core (! orig_val); +%! assert (orig_val, old_val); +%! assert (sighup_dumps_octave_core (), ! orig_val); +%! sighup_dumps_octave_core (orig_val); +%! assert (sighup_dumps_octave_core (), orig_val); */ DEFUN (sigterm_dumps_octave_core, args, nargout, @@ -1009,8 +1013,10 @@ /* %!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); +%! orig_val = sigterm_dumps_octave_core (); +%! old_val = sigterm_dumps_octave_core (! orig_val); +%! assert (orig_val, old_val); +%! assert (sigterm_dumps_octave_core (), ! orig_val); +%! sigterm_dumps_octave_core (orig_val); +%! assert (sigterm_dumps_octave_core (), orig_val); */