summaryrefslogtreecommitdiff
path: root/gtest/script
diff options
context:
space:
mode:
Diffstat (limited to 'gtest/script')
-rw-r--r--gtest/script/call_cfunction_get_value.lua15
-rw-r--r--gtest/script/call_cfunction_invalid_args.lua6
-rw-r--r--gtest/script/call_set_repeat.lua8
-rw-r--r--gtest/script/elua_time_out.lua (renamed from gtest/script/lua_time_out.lua)0
-rw-r--r--gtest/script/get_header.lua2
5 files changed, 30 insertions, 1 deletions
diff --git a/gtest/script/call_cfunction_get_value.lua b/gtest/script/call_cfunction_get_value.lua
new file mode 100644
index 0000000..044a036
--- /dev/null
+++ b/gtest/script/call_cfunction_get_value.lua
@@ -0,0 +1,15 @@
+local data = TSG.data
+
+local value = TSG.get_value()
+
+local retvalue = nil
+print(type(value))
+for k, v in pairs(value) do
+ if not retvalue then
+ retvalue = string.format("%s:%s", tostring(k), tostring(v))
+ else
+ retvalue = string.format("%s,%s:%s", retvalue, tostring(k), tostring(v))
+ end
+end
+
+return string.len(retvalue), retvalue \ No newline at end of file
diff --git a/gtest/script/call_cfunction_invalid_args.lua b/gtest/script/call_cfunction_invalid_args.lua
new file mode 100644
index 0000000..697139e
--- /dev/null
+++ b/gtest/script/call_cfunction_invalid_args.lua
@@ -0,0 +1,6 @@
+local data = TSG.data
+
+local str = TSG.get.get_hello("test", "Test")
+
+local ret = TSG.set.set_world(str, "world")
+return string.len(ret), ret \ No newline at end of file
diff --git a/gtest/script/call_set_repeat.lua b/gtest/script/call_set_repeat.lua
new file mode 100644
index 0000000..7591309
--- /dev/null
+++ b/gtest/script/call_set_repeat.lua
@@ -0,0 +1,8 @@
+local data = TSG.data;
+local ret = TSG.set_repeat()
+
+if type(ret) == "string" then
+ return string.len(ret), ret
+else
+ return ret
+end \ No newline at end of file
diff --git a/gtest/script/lua_time_out.lua b/gtest/script/elua_time_out.lua
index 112dabc..112dabc 100644
--- a/gtest/script/lua_time_out.lua
+++ b/gtest/script/elua_time_out.lua
diff --git a/gtest/script/get_header.lua b/gtest/script/get_header.lua
index 104ddd0..f770d60 100644
--- a/gtest/script/get_header.lua
+++ b/gtest/script/get_header.lua
@@ -13,7 +13,7 @@ end
local rsp_header = nil
header = TSG.rsp.get_header()
for k, v in pairs(header) do
- if not req_header then
+ if not rsp_header then
rsp_header = string.format("%s:%s", k, v)
else
rsp_header = string.format("%s,%s:%s", rsp_header, k, v)