diff UnitTestsSources/LuaTests.cpp @ 4031:e3b3af80732d

ServerResources, and moving EmbeddedResourceHttpHandler from Core to OrthancServer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 09 Jun 2020 21:31:13 +0200
parents 27628b0f6ada
children 058b5ade8acd
line wrap: on
line diff
--- a/UnitTestsSources/LuaTests.cpp	Tue Jun 09 20:50:20 2020 +0200
+++ b/UnitTestsSources/LuaTests.cpp	Tue Jun 09 21:31:13 2020 +0200
@@ -42,6 +42,8 @@
 #include "../Core/Toolbox.h"
 #include "../Core/Lua/LuaFunctionCall.h"
 
+#include <ServerResources.h>
+
 #include <boost/lexical_cast.hpp>
 
 #if !defined(UNIT_TESTS_WITH_HTTP_CONNEXIONS)
@@ -54,9 +56,13 @@
   Orthanc::LuaContext lua;
 
 #if ORTHANC_UNIT_TESTS_LINK_FRAMEWORK != 1
-  lua.Execute(Orthanc::EmbeddedResources::LUA_TOOLBOX);
+  {
+    std::string command;
+    Orthanc::ServerResources::GetFileResource(command, Orthanc::ServerResources::LUA_TOOLBOX);
+    lua.Execute(command);
+  }
 #endif
-  
+
   lua.Execute("a={}");
   lua.Execute("a['x'] = 10");
   lua.Execute("a['y'] = {}");
@@ -131,7 +137,12 @@
 TEST(Lua, Simple)
 {
   Orthanc::LuaContext lua;
-  lua.Execute(Orthanc::EmbeddedResources::LUA_TOOLBOX);
+
+  {
+    std::string command;
+    Orthanc::ServerResources::GetFileResource(command, Orthanc::ServerResources::LUA_TOOLBOX);
+    lua.Execute(command);
+  }
 
   {
     Orthanc::LuaFunctionCall f(lua, "PrintRecursive");