[Mono-dev] Reflection Emit issues

Gert Driesen gert.driesen at telenet.be
Mon Mar 12 09:21:55 EDT 2007


Hi Ayende,

 

I tried the tests myself (with SVN head), and did not even succeed in
running the complete test suite:

 

"no implementation for interface method
Rhino.Mocks.Interfaces.IMockedObject::g

_ProxyHash() in class .genericClass`1Proxy79e618bfe6044bb9bb680503b32a2e36

 

This application has requested the Runtime to terminate it in an unusual
way.

Please contact the application's support team for more information."

 

It would be great if you could create smaller test cases, and submit a bug
reports for these issues.

 

A good place to start would be running the unit tests of Castle on Mono, and
once these pass move on to the Rhino tests.

 

Gert

 

From: mono-devel-list-bounces at lists.ximian.com
[mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of Ayende Rahien
Sent: maandag 12 maart 2007 7:13
To: mono-devel-list at lists.ximian.com
Subject: [Mono-dev] Reflection Emit issues

 

Hi guys,
I have just attempted to run the Rhino Mocks test suite on Mono (Win32).
The result is about 300 failing tests. The root cause seems to be
differences in Reflection.Emit behavior.
Rhino Mocks is using Castle Dynamic Proxy 2 to generate proxies, and all
those tests are running on the Microsoft .NET implementation successfully. 

How to reproduce:
1/ Get the source from
https://rhino-tools.svn.sourceforge.net/svnroot/rhino-tools
2/ Build rhino-mocks (xbuild default.build )
3/ rhino-tools\rhino-mocks\Rhino.Mocks.Tests\bin\debug>"c:\Program
Files\Mono-1.2.3.1\bin\mono" MbUnit.GUI.exe

The result of one of the failing tests:

1)
Rhino.Mocks.Tests.FieldsProblem.PresenterBaseTestFixture.SetUp.TestEventInit
ialization.TearDown :
Argument cannot be null.
Parameter name: method
  at System.Reflection.Emit.ILGenerator.Emit (OpCode opcode,
System.Reflection.MethodInfo method) [0x00000] 
  at
Castle.DynamicProxy.Generators.Emitters.SimpleAST.MethodTokenExpression.Emit
(IMemberEmitter member, System.Reflection.Emit.ILGenerator gen) [0x00000] 
  at Castle.DynamicProxy.Generators.Emitters.SimpleAST.AssignStatement.Emit
(IMemberEmitter member, System.Reflection.Emit.ILGenerator gen) [0x00000] 
  at
Castle.DynamicProxy.Generators.Emitters.CodeBuilders.AbstractCodeBuilder.Gen
erate (IMemberEmitter member, System.Reflection.Emit.ILGenerator il)
[0x00000] 
  at Castle.DynamicProxy.Generators.Emitters.ConstructorEmitter.Generate ()
[0x00000] 
  at
Castle.DynamicProxy.Generators.Emitters.AbstractTypeEmitter.EnsureBuildersAr
eInAValidState () [0x00000] 
  at Castle.DynamicProxy.Generators.Emitters.AbstractTypeEmitter.BuildType
() [0x00000] 
  at
Castle.DynamicProxy.Generators.InterfaceProxyWithTargetGenerator.GenerateCod
e (System.Type proxyTargetType, System.Type[] interfaces,
Castle.DynamicProxy.ProxyGenerationOptions options) [0x00000] 
  at
Castle.DynamicProxy.DefaultProxyBuilder.CreateInterfaceProxyTypeWithoutTarge
t (System.Type theInterface, System.Type[] interfaces,
Castle.DynamicProxy.ProxyGenerationOptions options) [0x00000] 
  at
Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyTypeWithoutTarget
(System.Type theInterface, System.Type[] interfaces,
Castle.DynamicProxy.ProxyGenerationOptions options) [0x00000] 
  at Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget
(System.Type theInterface, System.Type[] interfaces,
Castle.DynamicProxy.ProxyGenerationOptions options,
Castle.Core.Interceptor.IInterceptor[] interceptors) [0x00000] 
  at Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget
(System.Type theInterface, System.Type[] interfaces,
Castle.Core.Interceptor.IInterceptor [] interceptors) [0x00000] 
  at Rhino.Mocks.MockRepository.MockInterface (Rhino.Mocks.CreateMockState
mockStateFactory, System.Type type, System.Type[] extras) [0x00000] 
  at Rhino.Mocks.MockRepository.CreateMockObject (System.Type type,
Rhino.Mocks.CreateMockState factory, System.Type[] extras, System.Object[]
argumentsForConstructor) [0x00000] 
  at Rhino.Mocks.MockRepository.DynamicMultiMock (System.Type mainType,
System.Type[] extraTypes, System.Object[] argumentsForConstructor) [0x00000]

  at Rhino.Mocks.MockRepository.DynamicMock (System.Type type,
System.Object[] argumentsForConstructor) [0x00000] 
  at Rhino.Mocks.Tests.FieldsProblem.PresenterBaseTestFixture.SetUp ()
[0x00000] 
  at <0x00000> <unknown method>
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke
(object,object[])
  at System.Reflection.MonoMethod.Invoke ( System.Object obj, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
System.Globalization.CultureInfo culture) [0x00000] 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070312/c9a743f2/attachment.html 


More information about the Mono-devel-list mailing list