[Mono-dev] [PATCH] System.IO.FileInfo.IsReadOnly
Raja R Harinath
rharinath at novell.com
Tue Sep 26 05:04:28 EDT 2006
Hi,
joel reed <joel.reed at ddiworld.com> writes:
> snip
>
>>> To really test it, you should have two separate FileInfo instances,
>>> and only
>>> modify the IsReadOnly property with one instance and verify it with the
>>> other one.
>
> Patch attached with improved test case.
>
> jr
>
>
> diff --git a/mcs/build/common/Consts.cs b/mcs/build/common/Consts.cs
> diff --git a/mcs/class/corlib/Test/System.IO/FileInfoTest.cs b/mcs/class/corlib/Test/System.IO/FileInfoTest.cs
> index daee031..7c49f39 100644
> --- a/mcs/class/corlib/Test/System.IO/FileInfoTest.cs
> +++ b/mcs/class/corlib/Test/System.IO/FileInfoTest.cs
> @@ -118,12 +118,17 @@ #if NET_2_0
> FileStream stream = File.Create (path);
> stream.WriteByte (12);
> stream.Close ();
> - FileInfo info = new FileInfo (path);
> - AssertEquals ("test#01", false, info.IsReadOnly);
> - info.IsReadOnly = true;
> - AssertEquals ("test#02", true, info.IsReadOnly);
> - info.IsReadOnly = false;
> - AssertEquals ("test#03", false, info.IsReadOnly);
> +
> + FileInfo info1 = new FileInfo (path);
> + AssertEquals ("test#01", false, info1.IsReadOnly);
> +
> + FileInfo info2 = new FileInfo (path);
> + info2.IsReadOnly = true;
> + AssertEquals ("test#02", true, info1.IsReadOnly);
> +
> + FileInfo info1 = new FileInfo (path);
> + info2.IsReadOnly = false;
> + AssertEquals ("test#03", false, info1.IsReadOnly);
> } finally {
> DeleteFile (path);
> }
This test doesn't compile. I changed the second 'info1' declaration to
'info3'. The testcase doesn't seem to work -- so I've disabled it in
the testsuite.
- Hari
More information about the Mono-devel-list
mailing list