summaryrefslogtreecommitdiffstats
path: root/tests/LuaThreadStress/Test.lua
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2017-01-15 16:10:06 +0100
committerGitHub <noreply@github.com>2017-01-15 16:10:06 +0100
commitfa69d09a497c24443dd5df3cba2ca08811f8649a (patch)
tree637f9430a4e49d6ac2e3612cb1c8b8cbeb2d3f9d /tests/LuaThreadStress/Test.lua
parentMoved cPrefab parser self-check to the LoadablePieces test. (#3536) (diff)
parentTests: Added LuaState thread stress-test. (diff)
downloadcuberite-fa69d09a497c24443dd5df3cba2ca08811f8649a.tar
cuberite-fa69d09a497c24443dd5df3cba2ca08811f8649a.tar.gz
cuberite-fa69d09a497c24443dd5df3cba2ca08811f8649a.tar.bz2
cuberite-fa69d09a497c24443dd5df3cba2ca08811f8649a.tar.lz
cuberite-fa69d09a497c24443dd5df3cba2ca08811f8649a.tar.xz
cuberite-fa69d09a497c24443dd5df3cba2ca08811f8649a.tar.zst
cuberite-fa69d09a497c24443dd5df3cba2ca08811f8649a.zip
Diffstat (limited to 'tests/LuaThreadStress/Test.lua')
-rw-r--r--tests/LuaThreadStress/Test.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/LuaThreadStress/Test.lua b/tests/LuaThreadStress/Test.lua
new file mode 100644
index 000000000..6053640b4
--- /dev/null
+++ b/tests/LuaThreadStress/Test.lua
@@ -0,0 +1,17 @@
+-- Test.lua
+
+-- Implements the test support functions
+-- This file is loaded into the cLuaState used for stress-testing
+
+
+
+
+
+--- Returns a function that the C++ code can call
+-- The callback takes a single number as param and returns the sum of the param and the seed, given to this factory function (for verification)
+function getCallback(a_Seed)
+ return function (a_Param)
+ -- print("Callback " .. a_Seed .. " called with param " .. a_Param)
+ return a_Param + a_Seed
+ end
+end