diff UnitTestsSources/Lua.cpp @ 712:9e3f21441903

lua tests
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 13 Feb 2014 16:16:07 +0100
parents 17815b9d4280
children 3d6f9b7d0add
line wrap: on
line diff
--- a/UnitTestsSources/Lua.cpp	Thu Feb 13 15:51:10 2014 +0100
+++ b/UnitTestsSources/Lua.cpp	Thu Feb 13 16:16:07 2014 +0100
@@ -3,7 +3,7 @@
 #include "../Core/Lua/LuaFunctionCall.h"
 
 
-TEST(Lua, Simple)
+TEST(Lua, Json)
 {
   Orthanc::LuaContext lua;
   lua.Execute(Orthanc::EmbeddedResources::LUA_TOOLBOX);
@@ -70,3 +70,34 @@
   ASSERT_FALSE(lua.IsExistingFunction("a"));
   ASSERT_FALSE(lua.IsExistingFunction("Dummy"));
 }
+
+
+TEST(Lua, Simple)
+{
+  Orthanc::LuaContext lua;
+  lua.Execute(Orthanc::EmbeddedResources::LUA_TOOLBOX);
+
+  {
+    Orthanc::LuaFunctionCall f(lua, "PrintRecursive");
+    f.PushString("hello");
+    f.Execute();
+  }
+
+  {
+    Orthanc::LuaFunctionCall f(lua, "PrintRecursive");
+    f.PushBoolean(true);
+    f.Execute();
+  }
+
+  {
+    Orthanc::LuaFunctionCall f(lua, "PrintRecursive");
+    f.PushInteger(42);
+    f.Execute();
+  }
+
+  {
+    Orthanc::LuaFunctionCall f(lua, "PrintRecursive");
+    f.PushDouble(3.1415);
+    f.Execute();
+  }
+}