[Mono-devel-list] GetHashCode () differences from Microsoft

Paolo Molaro lupus at ximian.com
Wed Jun 4 05:03:16 EDT 2003


On 06/02/03 Ben Maurer wrote:
> As you may know, I am running the Rotor Test Suite (found under
> /test/bcl/system in the sscli directory). I noticed that there are many
> differences between our GetHashCode methods and the ones in Microsoft's
> corlib.dll. This causes many of the Rotor tests to fail. Some examples
> of items that are failing are the GUID stuff and the char tests.

If the tests break because of the different GetHashCode() algorithm, the
tests are broken.

> It would be helpful for my testing to change our implementation to use
> the same methods as Rotor to obtain the hashcode of structures. This is
> not hard to do, especially since the license to Rotor allows us to take
> a look at the way they do it, take pseudo code notes, and make an
> implementation of our own. Does anyone have any strong feelings (either
> way), about this issue? Could I get an OK/Not OK from a few of the
> Ximian people? Of course, I am volunteering to make these changes, and
> would be happy to have my code reviewed.

You can certainly make those kind of changes to your local cvs tree,
but those changes should not be committed. The right thing to do is
to fix the tests to not depend on a particular GetHashCode()
implementation. As for looking at the rotor code, since you're not a
lawyer, nobody should trust what you say about what the rotor license
allows to do. We should stay on the safe side and pseudo code notes
are not, unless done by someone external to mono, IMHO.

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list