bugGNU Octave - Bugs: bug #48110, ishghandle silently ignores...

 
 

bug #48110: ishghandle silently ignores additional arguments

Submitter:  Markus Mützel <mmuetzel>
Submitted:  Fri 03 Jun 2016 09:40:17 AM UTC
   
 
Category:  Octave Function Severity:  1 - Wish
Priority:  3 - Low Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 03 Jun 2016 08:12:37 PM UTC, comment #3: 

I modified your patch and pushed it here (http://hg.savannah.gnu.org/hgweb/octave/rev/7f633f680f68)

In particular, the patch initially failed the BIST test below that I wrote.


%! assert (ishghandle ([-1 0], "foobar"), [false false]);


Thanks for providing a base changeset to work off.  It made it quite quick work to close this bug report.

Rik <rik5>
Group administrator
Fri 03 Jun 2016 04:00:53 PM UTC, comment #2: 

Octave generally doesn't try very hard to match undocumented Matlab behavior.  I've changed the Severity to 'Wish' and the Priority to 'Low'.

As for input validation, Octave is usually stricter than Matlab.  I can see that one way would be to use varargin in this case and then pass all arguments to ishandle() which would then throw an error.

Rik <rik5>
Group administrator
Fri 03 Jun 2016 09:46:01 AM UTC, comment #1: 
Markus Mützel <mmuetzel>
Group administrator
Fri 03 Jun 2016 09:40:17 AM UTC, original submission:  

The function ishghandle in Matlab accepts the graphics object type as an additional un-documented argument.

hf = figure;
ishghandle (hf, 'figure')
ishghandle (hf, 'patch')


While the above returns true and false in Matlab, the result is true for both in Octave.

I'll send a patch that fixes this compatibility issue as soon as I have a bug number.

BTW: In Matlab, functions (without varargin) being called with more arguments than expected fail automatically. Octave silently ignores these additional arguments. Is this difference intentional?

Markus Mützel <mmuetzel>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #37372:  ishghandle_type.patch added by mmuetzel (4KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mmuetzel (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-06-03 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2016-06-03 mtmiller StatusConfirmed Patch Submitted
    2016-06-03 rik5 Severity3 - Normal 1 - Wish
        Priority5 - Normal 3 - Low
        StatusNone Confirmed
    2016-06-03 mmuetzel Attached File- Added ishghandle_type.patch, #37372

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code