Commit a0e1671c authored by Vinicius Jarina's avatar Vinicius Jarina
Browse files

Fixed test LuaBaseMethod on iOS.

parent d69cf176
......@@ -55,11 +55,139 @@ Global
$2.inheritsScope = text/x-csharp
$2.scope = text/x-csharp
$0.TextStylePolicy = $3
$3.FileWidth = 120
$3.TabsToSpaces = True
$3.inheritsSet = Mono
$3.inheritsScope = text/plain
$3.scope = text/plain
$0.StandardHeader = $4
$4.Text =
$4.IncludeInNewFiles = True
$0.NameConventionPolicy = $5
$5.Rules = $6
$6.NamingRule = $7
$7.Name = Namespaces
$7.AffectedEntity = Namespace
$7.VisibilityMask = VisibilityMask
$7.NamingStyle = PascalCase
$7.IncludeInstanceMembers = True
$7.IncludeStaticEntities = True
$6.NamingRule = $8
$8.Name = Types
$8.AffectedEntity = Class, Struct, Enum, Delegate
$8.VisibilityMask = Public
$8.NamingStyle = PascalCase
$8.IncludeInstanceMembers = True
$8.IncludeStaticEntities = True
$6.NamingRule = $9
$9.Name = Interfaces
$9.RequiredPrefixes = $10
$10.String = I
$9.AffectedEntity = Interface
$9.VisibilityMask = Public
$9.NamingStyle = PascalCase
$9.IncludeInstanceMembers = True
$9.IncludeStaticEntities = True
$6.NamingRule = $11
$11.Name = Attributes
$11.RequiredSuffixes = $12
$12.String = Attribute
$11.AffectedEntity = CustomAttributes
$11.VisibilityMask = Public
$11.NamingStyle = PascalCase
$11.IncludeInstanceMembers = True
$11.IncludeStaticEntities = True
$6.NamingRule = $13
$13.Name = Event Arguments
$13.RequiredSuffixes = $14
$14.String = EventArgs
$13.AffectedEntity = CustomEventArgs
$13.VisibilityMask = Public
$13.NamingStyle = PascalCase
$13.IncludeInstanceMembers = True
$13.IncludeStaticEntities = True
$6.NamingRule = $15
$15.Name = Exceptions
$15.RequiredSuffixes = $16
$16.String = Exception
$15.AffectedEntity = CustomExceptions
$15.VisibilityMask = VisibilityMask
$15.NamingStyle = PascalCase
$15.IncludeInstanceMembers = True
$15.IncludeStaticEntities = True
$6.NamingRule = $17
$17.Name = Methods
$17.AffectedEntity = Methods
$17.VisibilityMask = Protected, Public
$17.NamingStyle = PascalCase
$17.IncludeInstanceMembers = True
$17.IncludeStaticEntities = True
$6.NamingRule = $18
$18.Name = Static Readonly Fields
$18.AffectedEntity = ReadonlyField
$18.VisibilityMask = Protected, Public
$18.NamingStyle = PascalCase
$18.IncludeInstanceMembers = False
$18.IncludeStaticEntities = True
$6.NamingRule = $19
$19.Name = Fields
$19.AffectedEntity = Field
$19.VisibilityMask = Protected, Public
$19.NamingStyle = PascalCase
$19.IncludeInstanceMembers = True
$19.IncludeStaticEntities = True
$6.NamingRule = $20
$20.Name = ReadOnly Fields
$20.AffectedEntity = ReadonlyField
$20.VisibilityMask = Protected, Public
$20.NamingStyle = PascalCase
$20.IncludeInstanceMembers = True
$20.IncludeStaticEntities = False
$6.NamingRule = $21
$21.Name = Constant Fields
$21.AffectedEntity = ConstantField
$21.VisibilityMask = Protected, Public
$21.NamingStyle = PascalCase
$21.IncludeInstanceMembers = True
$21.IncludeStaticEntities = True
$6.NamingRule = $22
$22.Name = Properties
$22.AffectedEntity = Property
$22.VisibilityMask = Protected, Public
$22.NamingStyle = PascalCase
$22.IncludeInstanceMembers = True
$22.IncludeStaticEntities = True
$6.NamingRule = $23
$23.Name = Events
$23.AffectedEntity = Event
$23.VisibilityMask = Protected, Public
$23.NamingStyle = PascalCase
$23.IncludeInstanceMembers = True
$23.IncludeStaticEntities = True
$6.NamingRule = $24
$24.Name = Enum Members
$24.AffectedEntity = EnumMember
$24.VisibilityMask = VisibilityMask
$24.NamingStyle = PascalCase
$24.IncludeInstanceMembers = True
$24.IncludeStaticEntities = True
$6.NamingRule = $25
$25.Name = Parameters
$25.AffectedEntity = Parameter
$25.VisibilityMask = VisibilityMask
$25.NamingStyle = CamelCase
$25.IncludeInstanceMembers = True
$25.IncludeStaticEntities = True
$6.NamingRule = $26
$26.Name = Type Parameters
$26.RequiredPrefixes = $27
$27.String = T
$26.AffectedEntity = TypeParameter
$26.VisibilityMask = VisibilityMask
$26.NamingStyle = PascalCase
$26.IncludeInstanceMembers = True
$26.IncludeStaticEntities = True
$0.DotNetNamingPolicy = $28
$28.DirectoryNamespaceAssociation = None
$28.ResourceNamePolicy = FileFormatDefault
description = LuaInterface
version = 2.x
EndGlobalSection
......
......@@ -1368,17 +1368,55 @@ public class LuaTests
//Console.WriteLine("interface returned: "+a);
}
}
#region LUA_BOILERPLATE_CLASS
/*** This class is used to bind the .NET world with the Lua world, this boilerplate code is pratically the same, get values call Lua function return value back,
* this class is usually dynamic generated using System.Reflection.Emit, but this will not work on iOS. */
* this class is usually dynamic generated using System.Reflection.Emit, but this will not work on iOS. */
class LuaTestClassHandler: TestClass, ILuaGeneratedType
{
public LuaTable __luaInterface_luaTable;
public Type[][] __luaInterface_returnTypes;
public LuaTestClassHandler (LuaTable luaTable, Type[][] returnTypes)
{
__luaInterface_luaTable = luaTable;
__luaInterface_returnTypes = returnTypes;
}
public LuaTable __luaInterface_getLuaTable ()
{
return __luaInterface_luaTable;
}
public override int overridableMethod(int x, int y)
{
object [] args = new object [] {
__luaInterface_luaTable,
x,
y
};
object [] inArgs = new object [] {
__luaInterface_luaTable,
x,
y
};
int [] outArgs = new int [] { };
Type [] returnTypes = __luaInterface_returnTypes [0];
LuaFunction function = LuaInterface.Method.LuaClassHelper.getTableFunction (__luaInterface_luaTable, "overridableMethod");
object ret = LuaInterface.Method.LuaClassHelper.callFunction (function, args, returnTypes, inArgs, outArgs);
return (int) ret;
}
}
class LuaITestClassHandler : ILuaGeneratedType, ITest
{
public LuaTable __luaInterface_luaTable;
public Type[][] __luaInterface_returnTypes;
public LuaITestClassHandler (LuaTable luaTable, Type[][] returnTypes)
public LuaITestClassHandler (LuaTable luaTable, Type[][] returnTypes)
{
__luaInterface_luaTable = luaTable;
__luaInterface_returnTypes = returnTypes;
......@@ -1617,6 +1655,7 @@ public class LuaTests
public void LuaTableBaseMethod ()
{
using (Lua lua = new Lua () ) {
lua.RegisterLuaClassType (typeof (TestClass), typeof (LuaTestClassHandler));
lua.DoString ("luanet.load_assembly('LuaInterfaceTest')");
lua.DoString ("TestClass=luanet.import_type('LuaInterfaceTest.Mock.TestClass')");
lua.DoString ("test={}");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment