octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #57456] "test rand.cc" produces onCleanup erro


From: Rik
Subject: [Octave-bug-tracker] [bug #57456] "test rand.cc" produces onCleanup error
Date: Fri, 20 Dec 2019 17:43:08 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

URL:
  <https://savannah.gnu.org/bugs/?57456>

                 Summary: "test rand.cc" produces onCleanup error
                 Project: GNU Octave
            Submitted by: rik5
            Submitted on: Fri 20 Dec 2019 02:43:05 PM PST
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Regression
                  Status: None
             Assigned to: jwe
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

Code to reproduce:


test rand.cc
warning: onCleanup: error caught while executing cleanup function:
'restore_rand_states' undefined near line 17, column 17


This is probably because of changes to scoping of functions and function
handles.  Also, the test.m file is exceedingly complex with try/catch,
unwind_protect blocks, and eval'ing of functions in to existence.  It's not a
surprise that something small could affect this test.

The test code within rand.cc is


/*
%% Restore all rand* "seed" and "state" values in order, so that the
%% new "state" algorithm remains active after these tests complete.
%!function restore_rand_states (seed, state)
%!  rand ("seed", seed.rand);
%!  rande ("seed", seed.rande);
%!  randg ("seed", seed.randg);
%!  randn ("seed", seed.randn);
%!  randp ("seed", seed.randp);
%!  rand ("state", state.rand);
%!  rande ("state", state.rande);
%!  randg ("state", state.randg);
%!  randn ("state", state.randn);
%!  randp ("state", state.randp);
%!endfunction

%!shared __random_statistical_tests__, old_seed, old_state, restore_state
%! ## Flag whether the statistical tests should be run in "make check" or not
%! __random_statistical_tests__ = 0;
%! ## Save and restore the states of each of the random number generators
%! ## that are tested by the unit tests in this file.
%! old_seed.rand = rand ("seed");
%! old_seed.rande = rande ("seed");
%! old_seed.randg = randg ("seed");
%! old_seed.randn = randn ("seed");
%! old_seed.randp = randp ("seed");
%! old_state.rand = rand ("state");
%! old_state.rande = rande ("state");
%! old_state.randg = randg ("state");
%! old_state.randn = randn ("state");
%! old_state.randp = randp ("state");
%! restore_state = onCleanup (@() restore_rand_states (old_seed, old_state));
*/







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57456>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]