patch - tests in bitfcns

John W. Eaton jwe at octave.org
Wed Jul 15 13:26:59 CDT 2009


On 14-Jul-2009, Robert T. Short wrote:

| Attached is a patch that adds tests to src/bitfcns.cc.
| 
| Some notes.
| 
| MATLAB does not support the bit operations on signed types (int8, int16, 
| int32, int64) so the tests for those do not run in MATLAB.
| 
| The tests for the uint types all work in MATLAB.  There are some 
| "xtests" for tests that pass in MATLAB but fail in octave.  I assume 
| these are bugs.

You have

  xtest assert(bitshift(uint8(0:15),1),uint8(3),uint8([0 2 4 6 0 2 4 6 0 2 4 6 0 2 4 6]))

Adding some whitespace so I can see what is going on, this is

  assert (bitshift (uint8 (0:15), 1),
          uint8 (3),
          uint8 ([0 2 4 6 0 2 4 6 0 2 4 6 0 2 4 6]))

Did you really mean

  assert (bitshift (uint8 (0:15), 1, uint8 (3)),
          uint8 ([0 2 4 6 0 2 4 6 0 2 4 6 0 2 4 6]))

?  If so, then I think Octave also passes this test.

jwe


More information about the Octave-maintainers mailing list