[Mono-devel-list] System.Drawing.Color new testcases

Andre Skiba andrews at mainsoft.com
Tue Jul 26 07:11:06 EDT 2005


I found some differents in behavior of System.Drawing.Color in dotnet
and mono. The attached patches add testcases to reveal these
differences, and the second patch fixes those testcases.

Testcases.patch has 2 new testcases and a fix for TestHBSValues

The fix is necessary, because current TestHBSValues fails on dotnet. The
problem is using AssertEquals on floating point values. I fixed the
testcase to make comparison up to some tolerance (I set it to be 0.01%
of the values' sum).

Color.patch has 2 big fixes.

Fix for Equals, operator == and operator != was done in one place:
operator == (). Also, I broke down the lengthy conditional expression in
this operator, so it's more readable and allowed to add additional

Fix for IsEmpty required little refactoring - the easy way was to add
isemptycolor boolean. But it turned out to be more complicated than
uniting all isXXXcolor into flags enum.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestColor.patch
Type: application/octet-stream
Size: 2200 bytes
Desc: TestColor.patch
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050726/9c7dc30e/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Color.patch
Type: application/octet-stream
Size: 6391 bytes
Desc: Color.patch
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050726/9c7dc30e/attachment-0001.obj 

More information about the Mono-devel-list mailing list