bugGNU Octave - Bugs: bug #47778, textscan ReturnOnError setting...

 
 

bug #47778: textscan ReturnOnError setting misinterpreted in test

Submitter:  Philip Nienhuis <philipnienhuis>
Submitted:  Sun 24 Apr 2016 09:13:09 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Philip Nienhuis Open/Closed:  * Closed
Release:  * dev Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 25 Apr 2016 07:44:16 PM UTC, comment #3: 

Yep, it appears that when building new versions in an existing mxe-octave build tree the extracted test files do not seem to get renewed. At least, that's what I find here.

Sorry for the noise.

Closing with "invalid" (for the proper stats)

Philip Nienhuis <philipnienhuis>
Group Member
Mon 25 Apr 2016 04:25:02 PM UTC, comment #2: 

I can't find these tests either.  I'm marking as "Works For Me" because I don't see any test failures.

Rik <rik5>
Group administrator
Sun 24 Apr 2016 11:51:49 PM UTC, comment #1: 

Interesting.  I can't find any "d = textscan" in the current tests.  It was used in the previous tests before some fixes of ReturnOnError.

Is it possible that there is an old  tst  file in your MXE-octave build tree?

Lachlan Andrew <lachlan>
Sun 24 Apr 2016 09:13:09 PM UTC, original submission:  

Investigating textscan FAILs on Windows with a just cross-compiled dev Octave, I found this behavior:

:
>>  fprintf (fid, "1 2 3\n4 s 6");
>>  fseek (fid, 0, "bof");
>> c = textscan (fid, "%f %f %f")
c =
{
  [1,1] =
     1
     4
  [1,2] =  2
  [1,3] =  3
}
>> fseek (fid, 0, "bof");
>> d = textscan (fid, "%f %f %f", "ReturnOnError", 1)
d =
{
  [1,1] =
     1
     4
  [1,2] =  2
  [1,3] =  3
}

:
assert (c, {[1;4], [2;NaN], [3;6]})
:
ASSERT errors for:  assert (cond {i},expected {i},tol)
  Location  |  Observed  |  Expected  |  Reason
     .          O(1x1)       E(2x1)      Dimensions don't match


Now, the first call is functionally the same as the second, as ReturnOnError's default setting = "true" (at least it is in Matlab), and should return the same data as the second.

I think the first textscan call should rather be:
c = textscan (fid, "%f %f %f", "ReturnOnError", 0);
and the assert should rather check for an error message like "error: textscan: Read error in field"

Philip Nienhuis <philipnienhuis>
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

Items that depend on this one: None found

 

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

    Date Changed by Updated Field Previous Value => Replaced by
    2016-04-25 philipnienhuis StatusWorks For Me Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2016-04-25 rik5 StatusNone Works For Me

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code