[Mono-devel-list] Corlib test cases

David Sheldon dave-monolist at earth.li
Sat Jan 24 04:29:50 EST 2004

On Thu, Jan 22, 2004 at 11:43:31PM +0000, David Sheldon wrote:
> I have been trying to assign bug numbers to the tests that I can see
> failing. 

Another 10, this seems to be a reasonably manageable number to include
at a time. This is a batch of file system bugs. Is there a simple way of
only having some tests run on Windows? Is this something we would want
to do for the CreationTime ones for example?

> 20) MonoTests.System.IO.FileStreamTest.CtorDirectoryNotFoundException : Expected: DirectoryNotFoundException but was FileNotFoundException
> in [0x0013e] (at /home/sheldon/hacking/mono/raw_cvs/mcs/class/corlib/System.IO/FileStream.cs:130) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,bool)
> in [0x00018] (at /home/sheldon/hacking/mono/raw_cvs/mcs/class/corlib/System.IO/FileStream.cs:68) System.IO.FileStream:.ctor (string,System.IO.FileMode)
> in <0x00065> (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode)
> in [0x00031] (at /home/sheldon/hacking/mono/raw_cvs/mcs/class/corlib/Test/System.IO/FileStreamTest.cs:171) MonoTests.System.IO.FileStreamTest:CtorDirectoryNotFoundException ()

Reported as http://bugs.ximian.com/show_bug.cgi?id=53236

> 21) MonoTests.System.IO.FileStreamTest.CtorArgumentOutOfRangeException4 : Expected: ArgumentOutOfRangeException but was ArgumentException

Fixed.  This wasn't thrown because we test for the other exception first. I
have altered the test case to only test the relevent parameter.

> 22) MonoTests.System.IO.FileStreamTest.CtorIOException : IOException was expected

http://bugs.ximian.com/show_bug.cgi?id=53289 - FileStream with
FileMode.CreateNew does not object if the file already exists

> 23) MonoTests.System.IO.FileStreamTest.TestLock : System.NotImplementedException : The requested feature is not yet implemented
> in [0x00005] (at /home/sheldon/hacking/mono/raw_cvs/mcs/class/corlib/System.IO/FileStream.cs:482) System.IO.FileStream:Lock (long,long)
> in [0x00063] (at /home/sheldon/hacking/mono/raw_cvs/mcs/class/corlib/Test/System.IO/FileStreamTest.cs:472) MonoTests.System.IO.FileStreamTest:TestLock ()

http://bugs.ximian.com/show_bug.cgi?id=53288 - File locking not implemented

> 24) MonoTests.System.IO.FileSystemInfoTest.CreationTimeFile : test#01 
> 	expected:<1999>
> 	 but was:<2004>
> in [0x0005f] (at /home/sheldon/hacking/mono/raw_cvs/mcs/class/corlib/Test/System.IO/FileSystemInfoTest.cs:62) MonoTests.System.IO.FileSystemInfoTest:CreationTimeFile ()

> 25) MonoTests.System.IO.FileSystemInfoTest.CreationTimeDirectory : test#01 
> 	expected:<1999>
> 	 but was:<2004>
> in [0x00054] (at /home/sheldon/hacking/mono/raw_cvs/mcs/class/corlib/Test/System.IO/FileSystemInfoTest.cs:111) MonoTests.System.IO.FileSystemInfoTest:CreationTimeDirectory ()

Creation time is not supported on Unix filesystems. 

> 26) MonoTests.System.IO.FileSystemInfoTest.CreationTimeNoFileOrDirectory : test#04 
> 	expected:<9>
> 	 but was:<0>
> in [0x00075] (at /home/sheldon/hacking/mono/raw_cvs/mcs/class/corlib/Test/System.IO/FileSystemInfoTest.cs:152) MonoTests.System.IO.FileSystemInfoTest:CreationTimeNoFileOrDirectory ()

> 27) MonoTests.System.IO.FileSystemInfoTest.DefaultLastAccessTime : test#04 
> 	expected:<9>
> 	 but was:<0>
> in [0x0006e] (at /home/sheldon/hacking/mono/raw_cvs/mcs/class/corlib/Test/System.IO/FileSystemInfoTest.cs:201) MonoTests.System.IO.FileSystemInfoTest:DefaultLastAccessTime ()
> in (unmanaged) /usr/local/lib/libmono.so.0 [0x40034b13]
> 28) MonoTests.System.IO.FileSystemInfoTest.DefaultLastWriteTime : test#04 
> 	expected:<9>
> 	 but was:<0>
> in [0x0006e] (at /home/sheldon/hacking/mono/raw_cvs/mcs/class/corlib/Test/System.IO/FileSystemInfoTest.cs:267) MonoTests.System.IO.FileSystemInfoTest:DefaultLastWriteTime ()

I think these are a bug in the tests. Here, the DefaultLastAccessTime is

 01/01/1601 00:00:00 

on MS.NET, however I suspect that is to do with me being in Britain, rather
than, say the West cost of the US. 

The tests should make sure the time is in the correct timezone before comparing them.

> 29) MonoTests.System.IO.FileTest.DeleteOpenStreamException : IOException was expected
This is a semantic difference between how Unix and Windows work at the
filesystem level. There are several programming idioms on Unix that involve
creating a file, opening it and then deleting it. Do we want to lose this idiom 
in order to be compatible here?

 "The nice thing about being a virus author is that you don't have to
             give technical support." - Dr. Alan Solomon.

More information about the Mono-devel-list mailing list