[Mono-dev] Patches for mono-winforms

Steven Boswell II ulatekh at yahoo.com
Sat Jun 2 21:36:34 UTC 2012


Oops, sorry.  I'm just so used to using LINQ. :-)  I can rewrite that portion of the test without it.  When I saw that "make test" built something called "System.Windows.Forms_test_net_4_5.dll", and "make check" said it was running against "CLR Version: 4.0.30319.17020", I didn't think I was limited to 2.0 features.

I was just adding to an existing test, not really changing it.  It still tests what it did before, just more.  But I can go revert the test-identifiers I changed.

In any case, enclosed is an updated patch.

I'm surprised no one else has thought of running Mono's unit tests against .NET, given how useful that would be for ensuring that Mono is compatible.

Steven Boswell


________________________________
 From: Stifu <stifu at free.fr>
To: mono-devel-list at lists.ximian.com 
Sent: Saturday, June 2, 2012 1:09 PM
Subject: Re: [Mono-dev] Patches for mono-winforms
 
Hmm, I don't think the added dependency to System.Linq in the tests is OK.
The whole thing is supposed to build and run with the .NET 2.0 profile.

Also, I could be wrong, but I think it's usually a bad idea to change
existing tests (unless they're wrong). Just make new tests instead
(SelectedRowsTest2(), or whatever). Can anyone confirm?

As explained here: http://www.mono-project.com/Test_Suite

"Include an unique message for each Assert() so that when the assert fails,
it is trivial to locate it in the source. Otherwise, it may be difficult to
determine which part of the test is failing. A good way to ensure unique
messages is to use something like #A01, #A02 etc.
(...)
Once you used such a number in an Assert(), don't change it later on -
people might use it it identify the test in bug reports or in mailing
lists."

"BTW, is there any built-in way to run these unit tests against .NET, to
make sure that what Mono does matches up with what .NET does?"

Not that I know of.


Steven Boswell II wrote
> 
> Enclosed is a replacement for the previous DataGridView.SelectionChanged()
> patch I submitted.  On top of containing the unit test, this one also adds
> a call to OnSelectionChanged() to
> DataGridView.OnColumnPostRemovedInternal() -- I had previously added a
> call to OnSelectionChanged() to DataGridView.OnRowsPostRemovedInternal().
> 
> Please let me know if this is what you expect of a unit test, then I'll
> try writing some for my other changes.
> 
> BTW, is there any built-in way to run these unit tests against .NET, to
> make sure that what Mono does matches up with what .NET does?
> 
> Steven Boswell
> 
> 
> ________________________________
>  From: Stifu <stifu@>
> To: mono-devel-list at .ximian 
> Sent: Saturday, June 2, 2012 8:45 AM
> Subject: Re: [Mono-dev] Patches for mono-winforms
>  
> Alright. Patch 6 has been pushed
> (https://github.com/mono/mono/commit/3d04a14a278d6160e33c16b52b86d68fe45d80b1).
> 
> I'll take care of the rest later, when I feel less lazy. :)
> About patch 1, if there are indeed 2 separate issues, then it's better to
> split the patch in 2, and also include 2 unit tests if possible.
> 
> Thanks.
> 
> 
> Steven Boswell II wrote
>> 
>> Patch 1 is for https://bugzilla.xamarin.com/show_bug.cgi?id=5419 .
>> Patch 2 is for https://bugzilla.xamarin.com/show_bug.cgi?id=5420 .
>> Patch 3 is for https://bugzilla.xamarin.com/show_bug.cgi?id=3415 .
>> I attached the relevant patch to all three of those bug reports.
>> Patch 6 is
>> for https://bugzilla.novell.com/show_bug.cgi?id=567331 and https://bugzilla.novell.com/show_bug.cgi?id=668012 .
>>  I would post my patches to those bug reports, but Novell wants WAY too
>> much personal information just to reply to a bug report.
>> I don't see reports for the other bugs.
>> 
>> I'll go read about NUnit now.
>> 
>> Thanks for reviewing my bug fixes!
>> 
>> Steven Boswell
>> 
>> 
>> ________________________________
>>  From: Stifu <stifu@>
>> To: mono-devel-list at .ximian 
>> Sent: Friday, June 1, 2012 4:33 PM
>> Subject: Re: [Mono-dev] Patches for mono-winforms
>>  
>> You could just write tests for what's easy to test, and leave the rest.
>> As a bonus, you could post links to related bug reports here, and attach
>> patch + unit test (if any) in each of them. You don't need to bother with
>> GitHub for now.
>> 
>> I'll have a look and review what I can.
>> 
>> Thanks.
>> 
>> 
>> Steven Boswell II wrote
>>> 
>>> I reported a few of them in Bugzilla, but I wasn't sure if that database
>>> got any attention, e.g. the DataGridView.SelectionRows bug wasreported
>>> months ago and go no reply.  I don't currently have an account on
>>> GitHub;
>>> if I absolutely must have one, I'll go make one, but I wasn't planning
>>> to
>>> do that unless I started making tons of changes or something.  Also, how
>>> does one write a unit test for something that has to be verified
>>> visually
>>> (e.g. fixing ToolStripItem.BackColor) or via user interaction (e.g.
>>> fixing
>>> DataGridView.SelectionRows)?  So I suppose, yes, I need help :-)
>>> 
>>> Steven Boswell
>>> 
>>> 
>>> 
>>> ________________________________
>>>  From: Stifu <stifu@>
>>> To: mono-devel-list at .ximian 
>>> Sent: Thursday, May 31, 2012 11:06 PM
>>> Subject: Re: [Mono-dev] Patches for mono-winforms
>>>  
>>> Hello,
>>> 
>>> Thanks for your work.
>>> 
>>> If I'm not mistaken, you reported each of these bugs, right? At least I
>>> could find the two first ones in bugzilla, but didn't go further.
>>> Anyway,
>>> I
>>> suggest you make pull requests for each bug separately, specifying the
>>> bug
>>> number. Also, please include unit tests with each patch, highlighting
>>> what
>>> was fixed. I know it's more work, but it will make commiters more
>>> confident
>>> with your changes, and will guarantee no one will ever break these parts
>>> again.
>>> 
>>> Let me know if you need help.
>>> 
>>> 
>>> Steven Boswell II wrote
>>>> 
>>>> I work in a shop where our apps are written with C# and WinForms.
>>>>  Thank
>>>> God for Mono; I'm allowed to do all my work under Linux with Mono, and
>>>> my
>>>> code works fine under MS Windows and .NET.
>>>> 
>>>> Recently, I ran into a showstopper bug in mono-winforms, and finally
>>>> decided to look through the code.  I fixed the bug quickly.  That led
>>>> me
>>>> to looking for the source of other, non-showstopper bugs I've
>>>> encountered,
>>>> and those went quickly too.  Enclosed is an archive with all of the bug
>>>> fixes I made, which were made against the latest version on GitHub.  (I
>>>> originally made these bug fixes against version 2.10.5, the most recent
>>>> one in Fedora Core 16's yum repos.)
>>>> 
>>>> Patch 1 implements the EditingControlShowing event in DataGridView.
>>>>  Before, it wasn't called at all.  I had to split a
>>>> DataGridViewCell.StyleEditingControl() method off of
>>>> DataGridViewCell.InitializeEditingControl(); under .NET, ComboBox.Items
>>>> is
>>>> initialized before EditingControlShowing is posted, and this split was
>>>> necessary to get Mono to work that way too.  Styles modified in the
>>>> EditingControlShowing event are now applied to text-box and checkbox
>>>> controls too, not just combo-boxes.
>>>> 
>>>> Patch 2 resolves different behavior between .NET and Mono when the user
>>>> leaves a DataGridView.  Under .NET, the last-edited cell is committed;
>>>> under Mono, changed made to the last-edited cell are lost.  It was a
>>>> one-line fix.
>>>> 
>>>> Patch 3 fires the DataGridView.SelectionChanged event when the selected
>>>> rows/columns changes.  Before, the values of the SelectedRows and
>>>> SelectedColumns properties were semi-random during the SelectionChanged
>>>> event; now they're accurate.
>>>> 
>>>> Patches 4 and 5 fix two different exception-throws I encountered when
>>>> ComboBox.Items.Remove() is called with an item that's not in the combo
>>>> box.  .NET doesn't throw any exceptions in this case.
>>>> 
>>>> Patch 6 fixes the implementation of BackColor on ToolStripItem objects.
>>>>  Now it behaves like it does under .NET, i.e. the BackColor setting on
>>>> menu items etc. shows up.
>>>> 
>>>> I would very much appreciate it if you would consider committing these
>>>> changes.  My MS-Windows-oriented co-workers were impressed by how
>>>> quickly
>>>> bugs in Mono can be found and fixed.  Who knows, maybe I'll get some
>>>> converts to open-source.  (It amazes me that this sort of thing still
>>>> has
>>>> to be evangelized...sigh.)
>>>> 
>>>> Steven Boswell
>>>> 
>>>> _______________________________________________
>>>> Mono-devel-list mailing list
>>>> Mono-devel-list at .ximian
>>>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>>> 
>>> 
>>> --
>>> View this message in context:
>>> http://mono.1490590.n4.nabble.com/Patches-for-mono-winforms-tp4649620p4649621.html
>>> Sent from the Mono - Dev mailing list archive at Nabble.com.
>>> _______________________________________________
>>> Mono-devel-list mailing list
>>> Mono-devel-list at .ximian
>>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>> _______________________________________________
>>> Mono-devel-list mailing list
>>> Mono-devel-list at .ximian
>>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>> 
>> 
>> --
>> View this message in context:
>> http://mono.1490590.n4.nabble.com/Patches-for-mono-winforms-tp4649620p4649644.html
>> Sent from the Mono - Dev mailing list archive at Nabble.com.
>> _______________________________________________
>> Mono-devel-list mailing list
>> Mono-devel-list at .ximian
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>> _______________________________________________
>> Mono-devel-list mailing list
>> Mono-devel-list at .ximian
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>> 
> 
> --
> View this message in context:
> http://mono.1490590.n4.nabble.com/Patches-for-mono-winforms-tp4649620p4649654.html
> Sent from the Mono - Dev mailing list archive at Nabble.com.
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at .ximian
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at .ximian
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 

--
View this message in context: http://mono.1490590.n4.nabble.com/Patches-for-mono-winforms-tp4649620p4649661.html
Sent from the Mono - Dev mailing list archive at Nabble.com.
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20120602/1f9eb574/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mwf-03-DataGridView-SelectionChanged.patch.bz2
Type: application/octet-stream
Size: 1810 bytes
Desc: not available
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20120602/1f9eb574/attachment-0001.obj>


More information about the Mono-devel-list mailing list