comparison UnitTestsSources/LuaTests.cpp @ 2947:11f8d72f366f

Lua 5.3.5
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 29 Nov 2018 18:40:51 +0100
parents 878b59270859
children 4e43e67f8ecf
comparison
equal deleted inserted replaced
2946:2e751f615e03 2947:11f8d72f366f
291 // The "http://www.orthanc-server.com/downloads/third-party/" does 291 // The "http://www.orthanc-server.com/downloads/third-party/" does
292 // not automatically redirect to HTTPS, so we cas use it even if the 292 // not automatically redirect to HTTPS, so we cas use it even if the
293 // OpenSSL/HTTPS support is disabled in curl 293 // OpenSSL/HTTPS support is disabled in curl
294 const std::string BASE = "http://www.orthanc-server.com/downloads/third-party/"; 294 const std::string BASE = "http://www.orthanc-server.com/downloads/third-party/";
295 295
296 #if LUA_VERSION_NUM >= 502
297 // Since Lua >= 5.2.0, the function "loadstring" has been replaced by "load"
298 lua.Execute("JSON = load(HttpGet('" + BASE + "JSON.lua')) ()");
299 #else
296 lua.Execute("JSON = loadstring(HttpGet('" + BASE + "JSON.lua')) ()"); 300 lua.Execute("JSON = loadstring(HttpGet('" + BASE + "JSON.lua')) ()");
301 #endif
302
297 const std::string url(BASE + "Product.json"); 303 const std::string url(BASE + "Product.json");
298 #endif 304 #endif
299 305
300 std::string s; 306 std::string s;
301 lua.Execute(s, "print(HttpGet({}))"); 307 lua.Execute(s, "print(HttpGet({}))");