view test/bug-53027/bug-53027.tst @ 31248:8b75954a4670

delaunayn: adjust node ordering for positive outward normal vectors (bug #53397) * delaunayn.m: Check sign of simplex volume, flip node order for negative volumes to ensure positive (outward-pointing) normal vectors. Add BISTs to check for positive volumes. * etc/News.8.md: Append function improvement note to delaunayn change paragraph under General Improvements.
author Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
date Thu, 29 Sep 2022 23:09:05 -0400
parents 34617dd78f02
children 332a6ccac881
line wrap: on
line source

%!function load53027 (fname)
%!  global X
%!  X = 2;
%!  load (fname);
%!  assert (X, 1);
%!endfunction

%!function save53027 (fname)
%!  global X
%!  X = 1;
%!  save (fname, "X");
%!endfunction

%!test <*53027>
%! global X
%! X = 0;
%! fname = tempname ();
%! save53027 (fname);
%! assert (X, 1);
%! load53027 (fname);
%! assert (X, 1);
%! load53027 (fname);
%! assert (X, 1);
%! clear X
%! assert (exist ("X"), 0);
%! clear -global X;  # cleanup after test

%!test <*53027>
%! [a, b] = ntest53027a ();
%! assert ([a, b], [0, 0])
%! clear -global x;  # cleanup after test

%!test <*53027>
%! [a, b] = ntest53027b ();
%! assert ([a, b], [0, 0])
%! clear -global x;  # cleanup after test

%!test <*53027>
%! [a, b] = ntest53027c ();
%! assert ([a, b], [0, 0])
%! clear -global x;  # cleanup after test

## Previous bugs have caused segfaults when executing script twice.
%!test <*53027>
%! gtest53027
%! assert (isempty (a) && isempty (c))
%! assert (isglobal ("a") && isglobal ("c"))
%! assert (! exist ("b"))
%! assert (isempty (xx) && ! isglobal ("xx"))
%! gtest53027
%! assert (isempty (a) && isempty (c))
%! assert (isglobal ("a") && isglobal ("c"))
%! assert (! exist ("b"))
%! assert (isempty (xx) && ! isglobal ("xx"))
%! clear -global a b c;