aboutsummaryrefslogtreecommitdiff
path: root/unit_tests/embedded_tests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unit_tests/embedded_tests.cpp')
-rw-r--r--unit_tests/embedded_tests.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/unit_tests/embedded_tests.cpp b/unit_tests/embedded_tests.cpp
index 04a8f87..388548d 100644
--- a/unit_tests/embedded_tests.cpp
+++ b/unit_tests/embedded_tests.cpp
@@ -139,13 +139,13 @@ namespace
139 139
140// ################################################################################################# 140// #################################################################################################
141 141
142TEST_CASE("lanes.embedding.with default allocator") 142TEST_CASE("lanes.embedding.with_default_allocator")
143{ 143{
144 local::EmbeddedLuaState S; 144 local::EmbeddedLuaState S;
145 145
146 // --------------------------------------------------------------------------------------------- 146 // ---------------------------------------------------------------------------------------------
147 147
148 SECTION("single state") 148 SECTION("single_state")
149 { 149 {
150 // this sends data in a linda. current contents: 150 // this sends data in a linda. current contents:
151 // key: short string 151 // key: short string
@@ -172,7 +172,7 @@ TEST_CASE("lanes.embedding.with default allocator")
172 172
173 // --------------------------------------------------------------------------------------------- 173 // ---------------------------------------------------------------------------------------------
174 174
175 SECTION("manual registration") 175 SECTION("manual_registration")
176 { 176 {
177 S.requireSuccess("require 'lanes'.configure{with_timers = false}"); 177 S.requireSuccess("require 'lanes'.configure{with_timers = false}");
178 178
@@ -192,7 +192,7 @@ TEST_CASE("lanes.embedding.with default allocator")
192 192
193 // try again after manual registration 193 // try again after manual registration
194 lua_pushcfunction(S, S.get_lanes_register()); // S: lanes_register 194 lua_pushcfunction(S, S.get_lanes_register()); // S: lanes_register
195 luaG_pushstring(S, LUA_IOLIBNAME); // S: lanes_register "io" 195 luaW_pushstring(S, LUA_IOLIBNAME); // S: lanes_register "io"
196 luaL_requiref(S, LUA_IOLIBNAME, luaopen_io, 1); // S: lanes_register "io" io 196 luaL_requiref(S, LUA_IOLIBNAME, luaopen_io, 1); // S: lanes_register "io" io
197 lua_call(S, 2, 0); // S: 197 lua_call(S, 2, 0); // S:
198 S.stackCheck(0); 198 S.stackCheck(0);
@@ -204,7 +204,7 @@ TEST_CASE("lanes.embedding.with default allocator")
204 204
205// this is not really a test yet, just something sitting here until it is converted properly 205// this is not really a test yet, just something sitting here until it is converted properly
206// currently it crashes with moonjit (but maybe I just need a more recent moonjit version) 206// currently it crashes with moonjit (but maybe I just need a more recent moonjit version)
207TEST_CASE("lanes.embedding.with custom allocator") 207TEST_CASE("lanes.embedding.with_custom_allocator")
208{ 208{
209 static constexpr auto logPrint = +[](lua_State* L) { 209 static constexpr auto logPrint = +[](lua_State* L) {
210 lua_getglobal(L, "ID"); // ID 210 lua_getglobal(L, "ID"); // ID
@@ -220,7 +220,7 @@ TEST_CASE("lanes.embedding.with custom allocator")
220 220
221 static constexpr auto launch_lane = +[](lua_CFunction on_state_create_, int id_, int n_) { 221 static constexpr auto launch_lane = +[](lua_CFunction on_state_create_, int id_, int n_) {
222 char script[500]; 222 char script[500];
223 lua_State* L = lua_newstate(local::allocf, nullptr); 223 lua_State* L = luaW_newstate(local::allocf, nullptr, luaL_makeseed(nullptr));
224 // _G.ID = id_ 224 // _G.ID = id_
225 luaL_openlibs(L); 225 luaL_openlibs(L);
226 luaL_dostring(L, "lanes = require 'lanes'"); 226 luaL_dostring(L, "lanes = require 'lanes'");