[Mono-devel-list] [PATCH] parameters validation testing in System.Collections.Specialized.ListDictionary.CopyTo()

Alon Gazit along at mainsoft.com
Tue Sep 2 03:56:20 EDT 2003


Hello,

The method System.Collections.Specialized.ListDictionary.CopyTo(Array
array, int index) should perform the following validation tests:
1. if the array parameter is null , the method should throw
ArgumentNullException.
2. if the index parameter's value is less than 0 ,  the method should
throw ArgumentOutOfRangeException

Steps to reproduce the problems:
1. create a new instance of ListDictionary
2. call the method CopyTo(Array array, int index) , with null and 0 as
parameters .
3. call the method CopyTo(Array array, int index) , with a one
dimensional array instance and -1 as parameters .

Actual Results:
the method does nothing.

Expected Results:
the method throws the relevant exception.

Enclosed is a small test case and a patch.

Thanks a lot,

Alon Gazit

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030902/b09fe9fb/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ListDictionary.cs.diff
Type: application/octet-stream
Size: 537 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030902/b09fe9fb/attachment.obj 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Test.cs
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20030902/b09fe9fb/attachment.pl 


More information about the Mono-devel-list mailing list