bugGNU Octave - Bugs: bug #61782, Improve input validation for patch...

 
 

bug #61782: Improve input validation for patch and fill

Submitter:  None
Submitted:  Sun 09 Jan 2022 06:36:29 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 11 Jan 2022 08:29:29 PM UTC, comment #2: 

It turns out the input validation for patch was all screwed up.  I fixed that on the development branch in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/36d940c58c2e).

Marking as Fixed and closing report.

Rik <rik5>
Group administrator
Tue 11 Jan 2022 03:38:12 PM UTC, comment #1: 

Confirmed.  This will need to be fixed on the development branch of Octave.  Re-titling bug report.

Rik <rik5>
Group administrator
Sun 09 Jan 2022 06:36:29 PM UTC, original submission:  

Hello Octave,

For patch and fill, some error meessages are difficult to understand.

Preparation: x = rand (1, 3); y = rand (1, 3);

Correct: patch (x, y, "c");  (draws a triangle)
     or:  fill (x, y, "c");  (same figure)

Test 1: Accidentally type x instead of c in color, so type:    patch (x, y, "x");
Expected error "x is not a valid color specification" but actual error is:

error: __go_patch__: set: invalid number of arguments, unable to create graphics handle

which does not say what the problem was or how it should be fixed.

Test 2: Accidentally forget to say which color, so type:    patch (x, y);
Expected error "missing argument 3 (color specification)" but actual error is:

error: varargin(3): out of bound 2 (dimensions are 1x2)

which also does not say what went wrong in the call.

Test 3: Accidentally forget to say color for fill, so type:       fill (x, y);
Error similar to Test 2 about vargin(3) out of bound 2.

For fill (x, y, "x") making a typo in color, fill says "Invalid call to fill" which is better than varrgin(3), though saying "invalid color" can be nicer.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  •  

    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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-01-11 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2022-01-11 rik5 Item GroupNone Unexpected Error or Warning
        StatusNone Confirmed
        Release6.3.0 dev
        SummaryErrors with patch and fill Improve input validation for patch and fill

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code