[Mono-dev] [Patch] NameObjectCollectionBase, HttpCookieCollection

Juraj Skripsky js at hotfeet.ch
Fri Dec 21 08:34:08 EST 2007


Hi Gert,

Sorry, I attached the wrong version.

Here you go again, it's the right one this time and also includes the
optimization suggested by Konstantin.

- Juraj


On Fri, 2007-12-21 at 13:09 +0100, Gert Driesen wrote:
> Hi Juraj,
> 
> I haven't checked, but are you sure the tests pass on both the 1.0 and the
> 2.0 profile.
> 
> I don't see any profile specific code in your patches.
> 
> Gert
> 
> -----Original Message-----
> From: mono-devel-list-bounces at lists.ximian.com
> [mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of Juraj
> Skripsky
> Sent: vrijdag 21 december 2007 12:51
> To: Gert Driesen
> Cc: mono-devel-list at lists.ximian.com
> Subject: Re: [Mono-dev] [Patch]
> NameObjectCollectionBase,HttpCookieCollection
> 
> Hi Gert,
> 
> Thanks for your thorough review! Attached is the lastest and greatest.
> All unit tests are updated and pass.
> 
> May I commit?
> 
> - Juraj
> 
> 
> On Thu, 2007-12-20 at 18:44 +0100, Gert Driesen wrote:
> > Hi Juraj,
> > 
> > I made some adjustments to your tests to get them to pass on both .NET 
> > 2.0
> > (SP1) and .NET 1.1.
> > 
> > I also improved some existing tests that may require additional 
> > changes before they pass on Mono.
> > 
> > Gert
> > 
> > PS. Sorry if the attachment is binary (Outlook, says it all ...).
> > 
> > -----Original Message-----
> > From: mono-devel-list-bounces at lists.ximian.com
> > [mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of Juraj 
> > Skripsky
> > Sent: donderdag 20 december 2007 10:38
> > To: Gert Driesen
> > Cc: mono-devel-list at lists.ximian.com
> > Subject: Re: [Mono-dev] [Patch]
> > NameObjectCollectionBase,HttpCookieCollection
> > 
> > Hi Gert,
> > 
> > I'm attaching my patches, updated as per your suggestions.
> > 
> > - Juraj
> > 
> > 
> > On Thu, 2007-12-20 at 10:06 +0100, Gert Driesen wrote:
> > > Hi Juraj,
> > > 
> > > I'd advise against using ExpectedException when multiple calls are 
> > > made in the test, as this may lead to false positives.
> > > 
> > > For example:
> > > 
> > > 	[Test]
> > > 	[ExpectedException (typeof (ArgumentException))]
> > > 	public void CopyTo_NotEnoughSpace () 
> > > 	{
> > > 		string [] array = new string [4];
> > > 		UnitTestNameObjectCollectionBase c = new 
> > > UnitTestNameObjectCollectionBase ();
> > > 		c.Add ("1", "mono");
> > > 		c.Add ("2", "MoNo");
> > > 		c.Add ("3", "mOnO");
> > > 		c.Add ("4", "MONO");
> > > 		((ICollection)c).CopyTo (array, 2);
> > > 	}
> > > 
> > > If any of the Add methods would lead to an ArgumentException, the 
> > > test would pass although you explicitly wanted to check if CopyTo 
> > > resulted in an ArgumentException.
> > > 
> > > I would advise the following code (which is more bloated, yes):
> > > 
> > > 	[Test]
> > > 	public void CopyTo_NotEnoughSpace () 
> > > 	{
> > > 		string [] array = new string [4];
> > > 		UnitTestNameObjectCollectionBase c = new 
> > > UnitTestNameObjectCollectionBase ();
> > > 		c.Add ("1", "mono");
> > > 		c.Add ("2", "MoNo");
> > > 		c.Add ("3", "mOnO");
> > > 		c.Add ("4", "MONO");
> > > 		try {
> > > 			((ICollection)c).CopyTo (array, 2);
> > > 			Assert.Fail ("#1");
> > > 		} catch (ArgumentException ex) {
> > > 			Assert.AreEqual (typeof (ArgumentException),
> > ex.GetType (), "#2");
> > > 			Assert.IsNull (ex.InnerException, "#3");
> > > 			Assert.IsNotNull (ex.Message, "#4");
> > > 			Assert.IsNull (ex.ParamName, "#5");
> > > 		}
> > > 	}
> > > 
> > > This also allows you to perform additional checks (eg. was there an 
> > > inner exception?).
> > > 
> > > Gert
> > > 
> > > -----Original Message-----
> > > From: mono-devel-list-bounces at lists.ximian.com
> > > [mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of Juraj 
> > > Skripsky
> > > Sent: woensdag 19 december 2007 11:27
> > > To: mono-devel-list at lists.ximian.com
> > > Subject: [Mono-dev] [Patch] NameObjectCollectionBase, 
> > > HttpCookieCollection
> > > 
> > > Hello,
> > > 
> > > Attached are three small patches for NameObjectCollectionBase.cs, 
> > > NameObjectCollectionBaseTest.cs and HttpCookieCollection.cs.
> > > 
> > > All unit tests pass on Mono. Could someone verify that the new unit 
> > > tests work on MS.NET?
> > > 
> > > May I commit?
> > > 
> > > - Juraj
> > > 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: HttpCookieCollection.patch
Type: text/x-patch
Size: 1254 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20071221/99171be6/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NameObjectCollectionBase.patch
Type: text/x-patch
Size: 3295 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20071221/99171be6/attachment-0001.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NameObjectCollectionBaseTest.patch
Type: text/x-patch
Size: 9145 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20071221/99171be6/attachment-0002.bin 


More information about the Mono-devel-list mailing list