Spam detection software, running on the system "polystimulus.com", has
identified this incoming email as possible spam.  The original message
has been attached to this so you can view it (if it isn't spam) or label
similar future email.  If you have any questions, see
the administrator of that system for details.

Content preview:  baseType.GetInterfaceMap(...) return a InterfaceMapping.
  InterfaceMapping is a struct (so its a value type) and can't be null, so
  Assert.IsNotNull isn't really correct. However on mono, with the
  following test case: --- using System; namespace TestApp { class Program
  { public static void Main (string[] args) { System.Type baseType =
  typeof(System.Byte[]); Console.WriteLine("Type has {0} interfaces.",
  baseType.GetInterfaces().Length); foreach (System.Type iface in
  baseType.GetInterfaces()) { Console.WriteLine(iface.FullName); [...] 

Content analysis details:   (5.5 points, 5.0 required)

 pts rule name              description
---- ---------------------- --------------------------------------------------
 2.0 RCVD_IN_SORBS_DUL      RBL: SORBS: sent directly from dynamic IP address
                            [68.95.150.106 listed in dnsbl.sorbs.net]
 1.8 RCVD_IN_DSBL           RBL: Received via a relay in list.dsbl.org
                            [<http://dsbl.org/listing?68.95.150.106>]
 1.7 RCVD_IN_NJABL_DUL      RBL: NJABL: dialup sender did non-local SMTP
                            [68.95.150.106 listed in combined.njabl.org]


--- Begin Message --- baseType.GetInterfaceMap(...) return a InterfaceMapping. InterfaceMapping is a struct (so its a value type) and can't be null, so Assert.IsNotNull isn't really correct.

However on mono, with the following test case:
---
using System;
namespace TestApp
{
   class Program
   {
       public static void Main (string[] args)
       {
           System.Type baseType = typeof(System.Byte[]);
Console.WriteLine("Type has {0} interfaces.", baseType.GetInterfaces().Length);
           foreach (System.Type iface in baseType.GetInterfaces())
           {
               Console.WriteLine(iface.FullName);

Console.WriteLine(baseType.GetInterfaceMap(iface).TargetType.FullName);
           }
       }
   }
}
--

I get:
Type has 0 interfaces.

On Mono, both 1.0 and 2.0.

That is completely wrong because if you look at the source, Array is declared as:
...
public abstract class Array : ICloneable, ICollection, IList, IEnumerable
       {

...

All array types are returning that. I'm wondering if there might be some implementation reason if we both have it wrong. :-> Worthy of a bug report ether way.

Zac



Voigt, Benjamin wrote:
Would someone please be so kind as to run the following unit test on Mono?  
It's written against Zanebug but should be easy to run with any testing 
framework.

using Adapdev.UnitTest;

[TestFixture]
class GetInterfaceMap
{
    [Test]
    public static void ByteArray()
    {
        System.Type baseType = typeof(System.Byte[]);
        foreach (System.Type iface in baseType.GetInterfaces())
        {
            System.Diagnostics.Trace.WriteLine(iface.FullName);
            Assert.IsNotNull(baseType.GetInterfaceMap(iface));
        }
    }
}

If it fails on Mono, can someone explain why?  If it succeeds, I'm off to tell 
Microsoft their .NET 2.0 runtime isn't worth the hard disk space to hold it....

I'm asking because Microsoft fails miserably for GetInterfaces()[4/5/6] which are 
IList<Byte>, ICollection<Byte>, and IEnumerable<Byte>:

------ Test started: Assembly: RealTime.Tests.dll ------

System.ICloneable
System.Collections.IList
System.Collections.ICollection
System.Collections.IEnumerable
System.Collections.Generic.IList`1[[System.Byte, mscorlib, Version=2.0.0.0, 
Culture=neutral, PublicKeyToken=b77a5c561934e089]]
TestCase 'M:GetInterfaceMap.ByteArray' failed: Interface not found.
        System.ArgumentException: Interface not found.
        at System.RuntimeTypeHandle.GetFirstSlotForInterface(IntPtr 
interfaceHandle)
        at System.RuntimeTypeHandle.GetFirstSlotForInterface(RuntimeTypeHandle 
interfaceHandle)
        at System.RuntimeType.GetInterfaceMap(Type ifaceType)
        Realtime\RealTimeTests\GetInterfaceMap.cs(13,0): at 
GetInterfaceMap.ByteArray()


0 passed, 1 failed, 0 skipped, took 1.39 seconds.
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list




--- End Message ---
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to