summaryrefslogtreecommitdiff
path: root/ThirdParty/toluapp/src/tests/tclass.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-11-08 01:17:11 +0800
committerchai <chaifix@163.com>2021-11-08 01:17:11 +0800
commitefce5b6bd5c9d4f8214a71e0f7a7c35751710a4c (patch)
tree0789475ded5c377667165a3ddb047ca6703bcf33 /ThirdParty/toluapp/src/tests/tclass.cpp
parented78df90944bbe6b7de7308bda2bf3a7f1bc3de6 (diff)
+ tolua
+ lpeg
Diffstat (limited to 'ThirdParty/toluapp/src/tests/tclass.cpp')
-rw-r--r--ThirdParty/toluapp/src/tests/tclass.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/ThirdParty/toluapp/src/tests/tclass.cpp b/ThirdParty/toluapp/src/tests/tclass.cpp
new file mode 100644
index 0000000..02ca770
--- /dev/null
+++ b/ThirdParty/toluapp/src/tests/tclass.cpp
@@ -0,0 +1,32 @@
+extern "C" {
+#include "lua.h"
+#include "lualib.h"
+#include "lauxlib.h"
+}
+
+#include "tclass.h"
+
+//Test::Tst_A* Test::Tst_A::last;
+//Test::Tst_B* Test::Tst_B::last;
+//Test::Tst_C* Test::Tst_C::last;
+
+extern "C" {
+ int tolua_tclass_open (lua_State*);
+}
+
+int main ()
+{
+ Test::Tst_B* b = new Test::Tst_B; // instance used in Lua code
+
+ lua_State* L = lua_open();
+ luaL_openlibs(L);
+ tolua_tclass_open(L);
+
+ luaL_dofile(L,"tclass.lua");
+
+ lua_close(L);
+
+ delete b;
+ return 0;
+}
+