bugGNU Octave - Bugs: bug #64351, Reporting from %!shared BIST tests...

 
 

bug #64351: Reporting from %!shared BIST tests is odd

Submitter:  Rik <rik5>
Submitted:  Mon 26 Jun 2023 06:06:56 PM UTC
   
 
Category:  Octave Function Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Other
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
   

Mon 26 Jun 2023 08:20:11 PM UTC, comment #2: 

Issue #2 was fixed by rewriting inappropriate %!shared blocks as just %!test blocks.  See http://hg.savannah.gnu.org/hgweb/octave/rev/4555f9918009.

Marking as Fixed and closing report.

Rik <rik5>
Group administrator
Mon 26 Jun 2023 06:47:21 PM UTC, comment #1: 

Issue #1 (newline) was easy to fix.  See changeset http://hg.savannah.gnu.org/hgweb/octave/rev/cb56ab555113.

Rik <rik5>
Group administrator
Mon 26 Jun 2023 06:06:56 PM UTC, original submission:  

Code to demonstrate is attached as shared1.m and shared2.m.

Code for shared1.m is:


%!shared x,y
%! x = ones (2,2,0);
%! y = zeros (2,2);

%!test
%! assert (x, y);


And when run


test shared1.m
***** test
 assert (x, y);
!!!!! test failed
ASSERT errors for:  assert (x,y)

  Location  |  Observed  |  Expected  |  Reason
     .         O(2x2x0)      E(2x2)      Dimensions don't match
shared variables     x = [](2x2x0)
    y =

       0   0
       0   0


It seems a bit confusing to have the line for the variable 'x' on the same line as "shared variables".  I think it would look better, and be less confusing, to have a newline after shared variables.

Code for shared2.m:


%!shared x,y
%! x = ones (2,2,0);
%! y = zeros (2,2);
%! assert (x, y);


And when run,


test shared2.m
***** shared x,y
 x = ones (2,2,0);
 y = zeros (2,2);
 assert (x, y);
!!!!! test failed
ASSERT errors for:  assert (x,y)

  Location  |  Observed  |  Expected  |  Reason
     .         O(2x2x0)      E(2x2)      Dimensions don't match
shared variables     x = [](0x0)
    y = [](0x0)


The print out is incorrect.  The variable 'y' is a 2x2 matrix.  This only happens because test statements (such as assert()) are used within a %!shared block rather than being in a separate %!test block.  Either the processing of %!shared blocks could be tweaked in test.m OR we make it a coding standard to only have assignments in %!shared blocks.


Rik <rik5>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #54875:  shared1.m added by rik5 (80B - text/x-objcsrc)
file #54876:  shared2.m added by rik5 (72B - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-06-26 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2023-06-26 rik5 Attached File- Added shared1.m, #54875
        Attached File- Added shared2.m, #54876

    Back to the top

    Powered by Savane 3.13-bb6a.
    Corresponding source code