bugGNU Octave - Bugs: bug #34897, fileread.m test fail on cygwin

 
 

bug #34897: fileread.m test fail on cygwin

Submitter:  marco atzeri <matzeri>
Submitted:  Fri 25 Nov 2011 04:23:25 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 27 Nov 2011 01:31:34 AM UTC, comment #4: 
Rik <rik5>
Group administrator
Sun 27 Nov 2011 01:20:22 AM UTC, comment #3: 


octave:1> test /pub/hg/octave/scripts/io/fileread.m
PASSES 4 out of 4 tests


marco atzeri <matzeri>
Sun 27 Nov 2011 12:14:11 AM UTC, comment #2: 

This is the stupid end-of-line issue which differs between UNIX, Mac, and Windows.  Does the test pass if you change the file to be opened in binary mode by omitting the 't' when opening the file?


fid = fopen (fname, "wt");

   should be

fid = fopen (fname, "w");


Rik <rik5>
Group administrator
Fri 25 Nov 2011 08:07:29 PM UTC, comment #1: 

Same on a recently compiled MinGW tip:

Philip@deskprn ~/octave/octave-3.5.x
$ hg tip
changeset:   13933:c3c8f513cf1f
tag:         tip
user:        Rik <octave@nomad.inbox5.com>
date:        Wed Nov 23 10:56:05 2011 -0800
summary:     NEWS: Clarify that uiXXX functions are experimental/preliminary.



assert (str',[cstr{1}, "\n", cstr{2}, "\n", cstr{3}, "\n"]) expected
Hello World
The answer is 42
Goodbye World
but got
Hello World

The answer is 42

Goodbye World


Philip Nienhuis <philipnienhuis>
Group Member
Fri 25 Nov 2011 04:23:25 PM UTC, original submission:  

on cygwin with gcc (GCC) 4.5.3

$ hg tip
changeset:   13930:fe088cef3503
tag:         tip
user:        Rik <octave@nomad.inbox5.com>
date:        Wed Nov 23 08:44:29 2011 -0800
summary:     doc: Add missing @group/@end group to orderfields docstring


the strings are incorrectly printed on file
with an additional CR.


>>>>> processing /pub/hg/octave/scripts/io/fileread.m

  *** test
 cstr = {"Hello World", "The answer is 42", "Goodbye World"};
 fname = tmpnam ();
 fid = fopen (fname, "wt");
 fprintf(fid, "%s\n", cstr{:})
 fclose (fid);
 str = fileread (fname);
 assert (str', [cstr{1} "\n" cstr{2} "\n" cstr{3} "\n"]);
 unlink (fname);
!!!!! test failed
assert (str',[cstr{1}, "\n", cstr{2}, "\n", cstr{3}, "\n"]) expected
Hello World
The answer is 42
Goodbye World
but got
Hello World^M
The answer is 42^M
Goodbye World^M



marco atzeri <matzeri>

 

(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 philipnienhuis (Posted a comment)
  • -email is unavailable- added by matzeri (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
    2011-11-27 rik5 StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2011-11-27 rik5 StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code