view test/bug-53599.tst @ 31177:c7c79973007f

Tiff: added octave_tiff_handle class to wrap the Tiff file pointer * __tiff__.cc (octave_tiff_handle): implemented a new class octave_tiff_handle as a child of octave_base_value to be a wrapper for the Tiff file handle to be passed to Octave instead of passing a pointer around. * __tiff__.cc (F__open_tiff__, F__tiff_close__): modified handling TIFF file pointer to use the new class (Other internal functions were modified as well). * Tiff.m: removed checking for closed file, it is now handled internally.
author magedrifaat <magedrifaat@gmail.com>
date Wed, 17 Aug 2022 18:51:16 +0200
parents 9080316864bf
children
line wrap: on
line source

%!function rval = sggval (val)
%!  global gval
%!  if (nargin == 1)
%!    gval = val;
%!  else
%!    rval = gval;
%!  endif
%!endfunction

%!test <*53599>
%! global gval
%! assert (isempty (gval))
%! sggval (13);
%! assert (sggval (), 13);
%! assert (gval, 13);
%! clear global gval
%! assert (sggval (), [])
%! gval = 42;
%! assert (sggval (), []);
%! clear gval
%! global gval
%! gval = 42;
%! assert (sggval (), 42);
%! clear -global gval;  # cleanup after test