Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
NLua
Commits
c6a65b2a
Commit
c6a65b2a
authored
Dec 22, 2014
by
Isaac Brodsky
Browse files
Style change & verify that the constructor makes something sensible in the test
parent
e4234666
Changes
2
Hide whitespace changes
Inline
Side-by-side
Core/NLua/Metatables.cs
View file @
c6a65b2a
...
...
@@ -1114,11 +1114,9 @@ namespace NLua
}
}
if
(
klass
.
UnderlyingSystemType
.
IsValueType
)
{
if
(
klass
.
UnderlyingSystemType
.
IsValueType
)
{
int
numLuaParams
=
LuaLib
.
LuaGetTop
(
luaState
);
if
(
numLuaParams
==
0
)
{
if
(
numLuaParams
==
0
)
{
translator
.
Push
(
luaState
,
Activator
.
CreateInstance
(
klass
.
UnderlyingSystemType
));
return
1
;
}
...
...
tests/LuaTests.cs
View file @
c6a65b2a
...
...
@@ -214,9 +214,9 @@ namespace NLuaTest
}
}
/*
* Tests structure creation via the default constructor
*/
/*
* Tests structure creation via the default constructor
*/
[
Test
]
public
void
TestStructDefaultConstructor
()
{
...
...
@@ -225,6 +225,7 @@ namespace NLuaTest
lua
.
DoString
(
"luanet.load_assembly('NLuaTest')"
);
lua
.
DoString
(
"TestStruct=luanet.import_type('NLuaTest.Mock.TestStruct')"
);
lua
.
DoString
(
"struct=TestStruct()"
);
Assert
.
AreEqual
(
new
TestStruct
(),
(
TestStruct
)
lua
[
"struct"
]);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment