patch - tests in bitfcns
Robert T. Short
octave at phaselockedsystems.com
Wed Jul 15 13:46:49 CDT 2009
John W. Eaton wrote:
> 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
>
>
>
Thanks. My bugs are better than octave bugs. Must have done something
dumb in the translation back from MATLAB to octave. I am still working
on automating the whole process, so I suppose glitches are inevitable.
Bob
More information about the Octave-maintainers
mailing list