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

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

[Octave-bug-tracker] [bug #59451] Function handle looses reference to it


From: JD
Subject: [Octave-bug-tracker] [bug #59451] Function handle looses reference to its target function
Date: Wed, 11 Nov 2020 20:03:51 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:82.0) Gecko/20100101 Firefox/82.0

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

                 Summary: Function handle looses reference to its target
function
                 Project: GNU Octave
            Submitted by: jdbancal
            Submitted on: Thu 12 Nov 2020 01:03:49 AM UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Regression
                  Status: None
             Assigned to: None
         Originator Name: JD
        Originator Email: 
             Open/Closed: Open
                 Release: 6.0.92
         Discussion Lock: Any
        Operating System: GNU/Linux

    _______________________________________________________

Details:

In an m-file, the command 'list = localfunctions()' returns a list of handles
to the functions declared inside the m-file. These can then be called be
called by simply typing 'list{1}', for instance, to call the first of these
functions. Similarly, 'nargin(list{1})' will tell how many inputs the
corresponding function accepts.

This works well in simple cases, but it seems that the handle obtained in this
way can sometimes get 'lost' along the way... A simple way to see this is with
the MOxUnit class for unit testing with Octave and Matlab. Here is how to
reproduce the problem.

- Download the class with 'git clone https://github.com/MOxUnit/MOxUnit'
- Go into the 'MOxUnit/MOxUnit' subfolder : 'cd MOxUnit/MOxUnit'
- Run 'moxunit_set_path()' within Octave to add the necessary path
- Go to the library's own test folder 'cd ../tests'
- Run the tests: 'moxunit_runtests'

All tests fail on Octave 6.0.92 because links to the tested functions are lost
in the process. This was not the case earlier, and is therefore a regression.
For instance, here is the output with Octave 5.2.0:


$ git clone https://github.com/MOxUnit/MOxUnit
Cloning into 'MOxUnit'...
remote: Enumerating objects: 1634, done.
remote: Total 1634 (delta 0), reused 0 (delta 0), pack-reused 1634
Receiving objects: 100% (1634/1634), 306.94 KiB | 924.00 KiB/s, done.
Resolving deltas: 100% (1106/1106), done.
$ cd MOxUnit/MOxUnit
$ octave-cli
GNU Octave, version 5.2.0
Copyright (C) 2020 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-pc-linux-gnu".

Additional information about Octave is available at https://www.octave.org.

Please contribute if you find this software useful.
For more information, visit https://www.octave.org/get-involved.html

Read https://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type 'news'.

octave:1> moxunit_set_path
octave:2> cd ../tests
octave:3> moxunit_runtests
warning: isdir is obsolete; use isfolder or dir_in_loadpath instead
suite: 99 tests
.............................ss....warning: findstr is obsolete; use strfind
instead
.........................
......................warning: strmatch is obsolete; use strncmp or strcmp
instead
.................
--------------------------------------------------

OK (passed=97, skipped=2)
ans = 1





    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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