bugGNU Octave - Bugs: bug #38291, Failing test in...

 
 

bug #38291: Failing test in scripts/plot/stemleaf.m

Submitter:  Julien Bect <jbect>
Submitted:  Sat 09 Feb 2013 03:44:16 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Build Failure
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 21 Feb 2013 12:27:27 PM UTC, comment #15: 

And, file 27434 should be pushed instead.
And, after that, the report can be closed.

Michael Godfrey <godfrey>
Group Member
Thu 21 Feb 2013 03:14:37 AM UTC, comment #14: 

Just to clarify: file #27473  should be removed from this
report and attached to a report on the behavior of the
signbit() function.

Michael Godfrey <godfrey>
Group Member
Thu 21 Feb 2013 02:54:00 AM UTC, comment #13: 

OK. I got that (finally)
So, what needs to be done to the changeset you applied
is change the bug #

But, I did not yet mean to submit this as a bug here.  There
was discussion on the maintainer's list about how to
deal with this problem which had pretty much settled on
the patch that you found here. I meant to submit it as as a new bug report.

Michael

Michael Godfrey <godfrey>
Group Member
Thu 21 Feb 2013 02:45:10 AM UTC, comment #12: 

Check Appendix D.4.  There is some information there on writing the ChangeLog.

Rik <rik5>
Group administrator
Thu 21 Feb 2013 02:43:23 AM UTC, comment #11: 

Rik,

I just send you a separate email explaining
what I did wrong when attaching the last
patch file.

Again, sorry!

Michael

Michael Godfrey <godfrey>
Group Member
Thu 21 Feb 2013 12:42:15 AM UTC, comment #10: 

Thanks Rik.

I will try to learn about the changeset format.
When I figure it out should the instructions be added to
the Contributing Guidelines Section of the Manual?

Michael Godfrey <godfrey>
Group Member
Wed 20 Feb 2013 11:37:16 PM UTC, comment #9: 

I added a ChangeLog-formatted entry to your second patch and pushed it here (http://hg.savannah.gnu.org/hgweb/octave/rev/7cfb186592de)

Rik <rik5>
Group administrator
Sun 17 Feb 2013 03:55:23 AM UTC, comment #8: 

New changeset which is the same as the previous
code change.  But, this one contains the updated
documentation.

Close after pushing...

(file #27473)

Michael Godfrey <godfrey>
Group Member
Sat 09 Feb 2013 07:00:47 PM UTC, comment #7: 

changeset which corrects == 1 to != 0 is attached.

After pushing this change this bug report can be closed.



(file #27434)

Michael Godfrey <godfrey>
Group Member
Sat 09 Feb 2013 05:39:31 PM UTC, comment #6: 

Aha.  I get
signbit(x)
ans =

   1   1   1   1   1   1   1   1   1   1   1   1   1   1   1

So, this is something that John Eaton could look at.
He just recently wrote the signbit() code.  I think
that it should return 1.  But, the documentation says
"non-zero."  So, either John will decide 1 is right, or
I will change stemleaf to test for non-zero.

If you need this to work right away, you could just make
the obvious change in stemleaf().  I will probably do that
anyhow. Line 206 needs == 1 replaced by != 0

Thanks for submitting this report.

Michael Godfrey <godfrey>
Group Member
Sat 09 Feb 2013 05:09:24 PM UTC, comment #5: 


octave:12> x = [22 12 28 52  39 2 12 0 11 11 42 38 44 18 44];
octave:13> x = -x
x =

  -22  -12  -28  -52  -39   -2  -12   -0  -11  -11  -42  -38  -44  -18  -44

octave:14> signbit(x)
ans =

   512   512   512   512   512   512   512   512   512   512   512   512   512   512   512

octave:15> signbit([-1 -0 0 1])
ans =

   512   512     0     0


Julien Bect <jbect>
Sat 09 Feb 2013 05:07:30 PM UTC, comment #4: 

And, at the same time, what does signbit(x)
yield.

Michael Godfrey <godfrey>
Group Member
Sat 09 Feb 2013 05:06:19 PM UTC, comment #3: 

Right. I got it backwards. stemleaf is dropping the

  1. value in the x vector.  There are several possibilities:


What do you get for x after:
x = [22 12 28 52  39 2 12 0 11 11 42 38 44 18 44];
x = -x;

If this produces all negative values (including -0)
then I think the problem may be in signbit() for 32bit
systems.

So, tell me what you get for x as above.

Thanks

Michael Godfrey <godfrey>
Group Member
Sat 09 Feb 2013 04:42:42 PM UTC, comment #2: 

Yes, it's the only test that fails (in steamleaf, I mean).

System: Ubuntu 12.10 / 32 bits

Here is what I get after running the test step by step in Octave:


octave:13> r2
r2 =

stem step: 10, data: unsorted.
Hinges:    lo: -42, hi: -11

  -5 | 2
  -4 | 244
  -3 | 98
  -2 | 28
  -1 | 22118
  -0 | 20

octave:14> rx
rx =

stem step: 10, data: unsorted.
Hinges:    lo: -42, hi: -11

  -5 | 2
  -4 | 244
  -3 | 98
  -2 | 28
  -1 | 22118
  -0 | 2


Julien Bect <jbect>
Sat 09 Feb 2013 04:10:39 PM UTC, comment #1: 

A few questions:

1. Is this the only test that fails?

2. What system are you using?

In any case, this is strange because the error
is in the stored result, not what stemleaf()
returned.  But, the display of the stored
result (r2 = ...) is correct.

You could try displaying r2 to see if the traling
"0" did not get stored.  You could do this test
directly in Octave, just copy/paste the r2 =
...


Michael Godfrey <godfrey>
Group Member
Sat 09 Feb 2013 03:44:16 PM UTC, original submission:  

I get the following test failure when doing "make check" (or "test stemleaf"):


>>>>> processing /media/data/sources/octave2/scripts/plot/stemleaf.m
  ***** test
 ## negative values from 0
 x = [22 12 28 52  39 2 12 0 11 11 42 38 44 18 44];
 x = -x;
 r2 = ["stem step: 10, data: unsorted.\nHinges:    lo: -42, hi: -11\n";...
 "  -5 | 2";"  -4 | 244";"  -3 | 98";"  -2 | 28";"  -1 | 22118";"  -0 | 20"];
 rx = stemleaf (x, 0);
 assert(r2, rx);
!!!!! test failed
assert (r2,rx) expected
stem step: 10, data: unsorted.
Hinges:    lo: -42, hi: -11

  -5 | 2
  -4 | 244
  -3 | 98
  -2 | 28
  -1 | 22118
  -0 | 2
but got
stem step: 10, data: unsorted.
Hinges:    lo: -42, hi: -11

  -5 | 2
  -4 | 244
  -3 | 98
  -2 | 28
  -1 | 22118
  -0 | 20


Julien Bect <jbect>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #27434:  stemleaf_upd_20130209.diff added by godfrey (729B - text/x-patch)

 

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 godfrey (Posted a comment)
  • -email is unavailable- added by jbect (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
    2013-02-20 rik5 StatusNone Fixed
        Open/ClosedOpen Closed
    2013-02-17 godfrey Attached File- Added signbit_logical_with_doc.diff, #27473
    2013-02-09 godfrey Attached File- Added stemleaf_upd_20130209.diff, #27434

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code