forked from Tencent/xLua
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Tencent#153 from lindaluo1113/master
增加UT用例
- Loading branch information
Showing
5 changed files
with
125 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -221,7 +221,12 @@ public static int VariableParamFunc(int i, params string[] strs) | |
{ | ||
return 0; | ||
} | ||
|
||
|
||
public static int VariableParamFunc2(params int[] strs) | ||
{ | ||
return strs.Length; | ||
} | ||
|
||
public static int TestEnumFunc(LuaTestType x) | ||
{ | ||
return (int)x; | ||
|
@@ -1938,4 +1943,35 @@ public int TwoDimensionListMethod(int[][] args) | |
} | ||
return value; | ||
} | ||
} | ||
|
||
//验证构造函数支持refer,out修饰符,[email protected] for v2.1.7 | ||
[LuaCallCSharp] | ||
public class ReferTestClass | ||
{ | ||
public ReferTestClass(int x, ref int y, out string z) | ||
{ | ||
var_x = x; | ||
var_y = y; | ||
y = y - 1; | ||
z = "test1"; | ||
var_z = z; | ||
} | ||
|
||
public ReferTestClass(int x, out string z) | ||
{ | ||
var_x = x; | ||
var_y = 10; | ||
z = "test3"; | ||
var_z = z; | ||
} | ||
|
||
public int Get_X_Y_ADD() | ||
{ | ||
return var_x + var_y; | ||
} | ||
|
||
private int var_x; | ||
private int var_y; | ||
private string var_z; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -515,6 +515,11 @@ public static int VariableParamFunc(int i, params int[] strs) | |
return 0; | ||
} | ||
|
||
public static int VariableParamFunc2(params int[] strs) | ||
{ | ||
return strs.Length; | ||
} | ||
|
||
public static string FirstPushEnumFunc(int i) | ||
{ | ||
string luaScript = @" | ||
|
@@ -995,4 +1000,35 @@ public int TwoDimensionListMethod(int[][] args) | |
} | ||
return value; | ||
} | ||
} | ||
|
||
|
||
//验证构造函数支持refer,out修饰符,[email protected] for v2.1.7 | ||
public class ReferTestClassReflect | ||
{ | ||
public ReferTestClassReflect(int x, ref int y, out string z) | ||
{ | ||
var_x = x; | ||
var_y = y; | ||
y = y - 1; | ||
z = "test1"; | ||
var_z = z; | ||
} | ||
|
||
public ReferTestClassReflect(int x, out string z) | ||
{ | ||
var_x = x; | ||
var_y = 10; | ||
z = "test3"; | ||
var_z = z; | ||
} | ||
|
||
public int Get_X_Y_ADD() | ||
{ | ||
return var_x + var_y; | ||
} | ||
|
||
private int var_x; | ||
private int var_y; | ||
private string var_z; | ||
} |