bugGNU Octave - Bugs: bug #35850, %!warning block does not clean...

 
 

bug #35850: %!warning block does not clean warning before test

Submitter:  CarnĂ« Draug <carandraug>
Submitted:  Thu 15 Mar 2012 03:05:14 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  rik5
Originator Name:  Open/Closed:  * Closed
Release:  * 3.6.1 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 14 Jul 2013 12:45:19 AM UTC, comment #3: 

Fixed in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/0d5d3e53255f).  There is some deeply buried bug when lastwarn() is used in try/catch blocks.  I worked around it since I couldn't figure out the true source of the error.

Rik <rik5>
Group administrator
Sat 17 Mar 2012 12:43:47 AM UTC, comment #2: 

I have an easy fix for this, BUT, the fix has revealed some strange behavior which was previously hidden.  I need to work on that before I can commit the patch.

Rik <rik5>
Group administrator
Thu 15 Mar 2012 05:41:06 PM UTC, comment #1: 

Confirmed on a recent tip.

Rik <rik5>
Group administrator
Thu 15 Mar 2012 03:05:14 PM UTC, original submission:  

Hi

the %!warning block for testing functions checks the actual last warning instead of the warnings received by the function.

For example, given the following function:


function test_warning
endfunction
%!warning <something> test_warning


testing this function should fail. However, if the previous warning was actually "something", testing this function will pass even though the function didn't actual emit any warning.

I don't know if I'm clear enough so here's an example to replicate the bug. Provided that the previous function is defined somewhere:


> test test_warning  # this is as expected although for the wrong reason
  ***** warning <something> test_warning
!!!!! expected <something> but got X11 DISPLAY environment variable not set
> warning ("something")
warning: something
> test test_warning  # the function doesn't actually emit the warning, this is incorrect
PASSES 1 out of 1 tests


Carnë Draug <carandraug>
Group Member

 

(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

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by carandraug (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-07-14 rik5 StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2013-04-07 rik5 Dependencies- bugs #38679 is dependent
    2012-03-17 rik5 StatusConfirmed In Progress
        Assigned toNone rik5
    2012-03-15 rik5 StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code