"Core/LuaInterface/LuaInterface.IOS.csproj" did not exist on "b5b573a3daec381f06391e890ebdc3fe09640659"
Commit c6a65b2a authored by Isaac Brodsky's avatar Isaac Brodsky
Browse files

Style change & verify that the constructor makes something sensible in the test

parent e4234666
...@@ -1114,11 +1114,9 @@ namespace NLua ...@@ -1114,11 +1114,9 @@ namespace NLua
} }
} }
if (klass.UnderlyingSystemType.IsValueType) if (klass.UnderlyingSystemType.IsValueType) {
{
int numLuaParams = LuaLib.LuaGetTop (luaState); int numLuaParams = LuaLib.LuaGetTop (luaState);
if (numLuaParams == 0) if (numLuaParams == 0) {
{
translator.Push (luaState, Activator.CreateInstance (klass.UnderlyingSystemType)); translator.Push (luaState, Activator.CreateInstance (klass.UnderlyingSystemType));
return 1; return 1;
} }
......
...@@ -214,9 +214,9 @@ namespace NLuaTest ...@@ -214,9 +214,9 @@ namespace NLuaTest
} }
} }
/* /*
* Tests structure creation via the default constructor * Tests structure creation via the default constructor
*/ */
[Test] [Test]
public void TestStructDefaultConstructor () public void TestStructDefaultConstructor ()
{ {
...@@ -225,6 +225,7 @@ namespace NLuaTest ...@@ -225,6 +225,7 @@ namespace NLuaTest
lua.DoString ("luanet.load_assembly('NLuaTest')"); lua.DoString ("luanet.load_assembly('NLuaTest')");
lua.DoString ("TestStruct=luanet.import_type('NLuaTest.Mock.TestStruct')"); lua.DoString ("TestStruct=luanet.import_type('NLuaTest.Mock.TestStruct')");
lua.DoString ("struct=TestStruct()"); lua.DoString ("struct=TestStruct()");
Assert.AreEqual (new TestStruct(), (TestStruct)lua ["struct"]);
} }
} }
......
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