mirror of https://github.com/mono/CppSharp.git
Browse Source
git-svn-id: https://mono-soc-2010.googlecode.com/svn/trunk/cppinterop@41 a470b8cb-0e6f-1642-1b45-71e107334c4bpull/1/head
10 changed files with 234 additions and 17 deletions
@ -0,0 +1,34 @@ |
|||||||
|
//
|
||||||
|
// Mono.VisualC.Interop.ABI.MsvcAbi.cs: An implementation of the Microsoft Visual C++ ABI
|
||||||
|
//
|
||||||
|
// Author:
|
||||||
|
// Alexander Corrado (alexander.corrado@gmail.com)
|
||||||
|
//
|
||||||
|
// Copyright (C) 2010 Alexander Corrado
|
||||||
|
//
|
||||||
|
|
||||||
|
using System; |
||||||
|
using System.Text; |
||||||
|
using System.Reflection; |
||||||
|
using System.Runtime.InteropServices; |
||||||
|
|
||||||
|
namespace Mono.VisualC.Interop.ABI { |
||||||
|
public class MsvcAbi : CppAbi { |
||||||
|
public MsvcAbi () |
||||||
|
{ |
||||||
|
} |
||||||
|
|
||||||
|
public override CallingConvention DefaultCallingConvention { |
||||||
|
get { |
||||||
|
throw new System.NotImplementedException (); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public override string GetMangledMethodName (MethodInfo methodInfo) |
||||||
|
{ |
||||||
|
throw new System.NotImplementedException (); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
} |
||||||
|
|
@ -0,0 +1,55 @@ |
|||||||
|
//
|
||||||
|
// CppLibraryTests.cs: Test cases to exercise CppLibrary
|
||||||
|
//
|
||||||
|
// Author:
|
||||||
|
// Alexander Corrado (alexander.corrado@gmail.com)
|
||||||
|
//
|
||||||
|
// Copyright (C) 2010 Alexander Corrado
|
||||||
|
//
|
||||||
|
|
||||||
|
using System; |
||||||
|
using NUnit.Framework; |
||||||
|
|
||||||
|
using Mono.VisualC.Interop; |
||||||
|
using Mono.VisualC.Interop.ABI; |
||||||
|
|
||||||
|
using Tests.Support; |
||||||
|
|
||||||
|
namespace Tests { |
||||||
|
[TestFixture] |
||||||
|
public class CppLibraryTests : CPPTestLibBase { |
||||||
|
|
||||||
|
[Test] |
||||||
|
[ExpectedException (typeof (ArgumentNullException))] |
||||||
|
public void TestCreateNullAbi () |
||||||
|
{ |
||||||
|
CppLibrary cppl = new CppLibrary ("foo", null); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
[ExpectedException (typeof (ArgumentNullException))] |
||||||
|
public void TestCreateNullLibName () |
||||||
|
{ |
||||||
|
CppLibrary cppl = new CppLibrary (null, new VirtualOnlyAbi ()); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void TestProperties () |
||||||
|
{ |
||||||
|
VirtualOnlyAbi abi = new VirtualOnlyAbi (); |
||||||
|
CppLibrary cppl = new CppLibrary ("FooLib", abi); |
||||||
|
Assert.AreEqual ("FooLib", cppl.Name, "#A1"); |
||||||
|
Assert.AreSame (abi, cppl.Abi, "#A2"); |
||||||
|
} |
||||||
|
|
||||||
|
[Test] |
||||||
|
public void TestGetClass () |
||||||
|
{ |
||||||
|
VirtualOnlyAbi abi = new VirtualOnlyAbi (); |
||||||
|
CppLibrary cppl = new CppLibrary ("FooLib", abi); |
||||||
|
EmptyTestInterface klass = cppl.GetClass<EmptyTestInterface,EmptyTestStruct,CPPTestLibBase> ("FooClass"); |
||||||
|
Assert.IsNotNull (klass, "#A1"); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
@ -0,0 +1,26 @@ |
|||||||
|
//
|
||||||
|
// ItaniumAbiTests.cs: Test cases to exercise the ItaniumAbi
|
||||||
|
//
|
||||||
|
// Author:
|
||||||
|
// Alexander Corrado (alexander.corrado@gmail.com)
|
||||||
|
//
|
||||||
|
// Copyright (C) 2010 Alexander Corrado
|
||||||
|
//
|
||||||
|
|
||||||
|
using System; |
||||||
|
using NUnit.Framework; |
||||||
|
|
||||||
|
using Mono.VisualC.Interop; |
||||||
|
using Mono.VisualC.Interop.ABI; |
||||||
|
using Tests.Support; |
||||||
|
|
||||||
|
namespace Tests { |
||||||
|
[TestFixture] |
||||||
|
public class ItaniumAbiTests : CPPTestLibBase { |
||||||
|
|
||||||
|
public ItaniumAbiTests () : base (new ItaniumAbi ()) |
||||||
|
{ |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
@ -0,0 +1,26 @@ |
|||||||
|
//
|
||||||
|
// MsvcAbiTests.cs: Test cases to exercise the MsvcAbi
|
||||||
|
//
|
||||||
|
// Author:
|
||||||
|
// Alexander Corrado (alexander.corrado@gmail.com)
|
||||||
|
//
|
||||||
|
// Copyright (C) 2010 Alexander Corrado
|
||||||
|
//
|
||||||
|
|
||||||
|
using System; |
||||||
|
using NUnit.Framework; |
||||||
|
|
||||||
|
using Mono.VisualC.Interop; |
||||||
|
using Mono.VisualC.Interop.ABI; |
||||||
|
using Tests.Support; |
||||||
|
|
||||||
|
namespace Tests { |
||||||
|
[TestFixture] |
||||||
|
public class MsvcAbiTests : CPPTestLibBase { |
||||||
|
|
||||||
|
public MsvcAbiTests () : base (new MsvcAbi ()) |
||||||
|
{ |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
Loading…
Reference in new issue