summaryrefslogtreecommitdiff
path: root/source/tests
diff options
context:
space:
mode:
Diffstat (limited to 'source/tests')
-rw-r--r--source/tests/02-luax/main.cpp2
-rw-r--r--source/tests/02-luax/script.lua14
-rw-r--r--source/tests/05-physfs/ok.txt0
-rw-r--r--source/tests/06-coroutine/main.cpp0
4 files changed, 8 insertions, 8 deletions
diff --git a/source/tests/02-luax/main.cpp b/source/tests/02-luax/main.cpp
index ebb9df8..d5fe3bf 100644
--- a/source/tests/02-luax/main.cpp
+++ b/source/tests/02-luax/main.cpp
@@ -302,6 +302,4 @@ int main()
state.DoString(script);
runtime.Close(L);
-
- getchar();
} \ No newline at end of file
diff --git a/source/tests/02-luax/script.lua b/source/tests/02-luax/script.lua
index 57c9664..7e553d2 100644
--- a/source/tests/02-luax/script.lua
+++ b/source/tests/02-luax/script.lua
@@ -66,7 +66,7 @@ function main()
------------------- plain class test
local Foo = Asura.Class("Foo")
- Foo.Ctor = function(self, age, name, boy)
+ Foo.__init = function(self, age, name, boy)
self.age = age
self.name = name
self.boy = boy
@@ -87,11 +87,11 @@ function main()
print(Coo.GetClassName())
local coo = Coo.New(20, "Wang", kid)
print(coo:GetAge())
- Coo.Ctor = function(self, age, name, boy)
+ Coo.__init = function(self, age, name, boy)
self.age = age - 1
self.name = boy:GetName()
self.boy = boy
- self.__base.Ctor(self, age, "Wangba", boy)
+ self.__base.__init(self, age, "Wangba", boy)
end
Coo.GetName = function(self)
local name = self.__base.GetName(self)
@@ -117,9 +117,9 @@ function main()
-- Boy2.Speak = function(self)
-- return self.__base.GetAge(self)
-- end
- -- Boy2.Ctor = function(self, age, name)
- -- print("ctor " .. age)
- -- print("ctor " .. name)
+ -- Boy2.__init = function(self, age, name)
+ -- print("__init " .. age)
+ -- print("__init " .. name)
-- end
-- local boy22 = Boy2.New(12, "Liu")
-- print(boy22)
@@ -128,6 +128,8 @@ function main()
------------------------gc test
local boy = Asura.SimBoy.New(11, "chaichai")
boy = nil
+
+ io.read()
end
function err(msg)
print(msg)
diff --git a/source/tests/05-physfs/ok.txt b/source/tests/05-physfs/ok.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/source/tests/05-physfs/ok.txt
diff --git a/source/tests/06-coroutine/main.cpp b/source/tests/06-coroutine/main.cpp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/source/tests/06-coroutine/main.cpp