bugGNU Octave - Bugs: bug #50157, fwrite input argument type

 
 

bug #50157: fwrite input argument type

Submitted by:  Guillaume <gyom>
Submitted on:  Thu 26 Jan 2017 04:09:40 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Regression
Status: FixedAssigned to: None
Originator Name: GuillaumeOpen/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Fri 27 Jan 2017 10:23:52 AM UTC, comment #9:

Many thanks for the quick fix - I can confirm it works fine now.

Guillaume <gyom>
Thu 26 Jan 2017 06:12:32 PM UTC, comment #8:

And yes, the tests are better, but many more could be added.

The tests I just added are good for scalar/matrix types, but not for reading without conversion (result is double) or for other conversion combinations when reading and writing. There's a lot to test for just fread/fwrite...

John W. Eaton <jwe>
Project Administrator
Thu 26 Jan 2017 06:11:04 PM UTC, comment #7:

Oh damn, I copied the test to a separate file for quick testing, then fixed the problems there and forgot to copy them back. Checking in a fix as soon as I can verify that I haven't made some other stupid mistake.

John W. Eaton <jwe>
Project Administrator
Thu 26 Jan 2017 05:49:05 PM UTC, comment #6:

New failing test in io.tst after running 'make check':

Looks like instances of "m" should be replaced with "m_in", and "s" with "s_in".

Rik <rik5>
Project Administrator
Thu 26 Jan 2017 05:40:13 PM UTC, comment #5:

On the testing note, we still don't have 100% function coverage, let alone 100% line coverage, but I think the test suite has grown large enough to finally be valuable. I don't think we are making so many quick fixes that lead to later bugs because more of those problems are getting caught early by the regression tests.

That's mostly a "hurray for us" statement as things are getting better.

Rik <rik5>
Project Administrator
Thu 26 Jan 2017 05:25:04 PM UTC, comment #4:

I pushed the following fix (with a test!):

http://hg.savannah.gnu.org/hgweb/octave/rev/8aba6d170887

Reopen if this doesn't fix the problem.

The skip parameter probably should be octave_idx_type, but that's something to fix for another day...

John W. Eaton <jwe>
Project Administrator
Thu 26 Jan 2017 05:13:15 PM UTC, comment #3:

jwe's diagnosis is correct. The problem is the difference between scalar/matrix rather than between say double/uint32. See the following.

Rik <rik5>
Project Administrator
Thu 26 Jan 2017 04:56:27 PM UTC, comment #2:

It's not the conversion routines, it's a mistake in the prototype for the write function for scalar integer octave_value types, int vs octave_idx_type. I'll fix.

John W. Eaton <jwe>
Project Administrator
Thu 26 Jan 2017 04:50:33 PM UTC, comment #1:

Confirmed. Octave seems to be missing a large number of conversion routines.

Rik <rik5>
Project Administrator
Thu 26 Jan 2017 04:09:40 PM UTC, original submission:

Running the follwing with current tip:

returns:

fwrite returns 1 as expected if second argument is double, or with 4.2.

Guillaume <gyom>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by gyom (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 26 Jan 2017 05:25:04 PM UTCjweStatusConfirmed=>Fixed
      Open/ClosedOpen=>Closed
    Thu 26 Jan 2017 04:50:33 PM UTCrik5StatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1