aboutsummaryrefslogtreecommitdiff
path: root/unit_tests/shared.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unit_tests/shared.cpp')
-rw-r--r--unit_tests/shared.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/unit_tests/shared.cpp b/unit_tests/shared.cpp
index e70d5d8..1197ce3 100644
--- a/unit_tests/shared.cpp
+++ b/unit_tests/shared.cpp
@@ -58,8 +58,8 @@ namespace
58 return 0; 58 return 0;
59 }; 59 };
60 60
61 // a function that sleeps for the specified duration (in seconds) 61 // a function that blocks for the specified duration (in seconds) by putting the current thread to sleep
62 lua_CFunction sSleepFor = +[](lua_State* const L_) { 62 lua_CFunction sBlockFor = +[](lua_State* const L_) {
63 std::chrono::time_point<std::chrono::steady_clock> _until{ std::chrono::time_point<std::chrono::steady_clock>::max() }; 63 std::chrono::time_point<std::chrono::steady_clock> _until{ std::chrono::time_point<std::chrono::steady_clock>::max() };
64 lua_settop(L_, 1); 64 lua_settop(L_, 1);
65 if (luaG_type(L_, kIdxTop) == LuaType::NUMBER) { // we don't want to use lua_isnumber() because of autocoercion 65 if (luaG_type(L_, kIdxTop) == LuaType::NUMBER) { // we don't want to use lua_isnumber() because of autocoercion
@@ -88,11 +88,11 @@ namespace
88 88
89 static luaL_Reg const sFixture[] = { 89 static luaL_Reg const sFixture[] = {
90 { "freezing_finalizer", sFreezingFinalizer }, 90 { "freezing_finalizer", sFreezingFinalizer },
91 { "give_me_back()", sGiveMeBack }, 91 { "give_me_back", sGiveMeBack },
92 { "newlightuserdata", sNewLightUserData }, 92 { "newlightuserdata", sNewLightUserData },
93 { "newuserdata", sNewUserData }, 93 { "newuserdata", sNewUserData },
94 { "on_state_create", sOnStateCreate }, 94 { "on_state_create", sOnStateCreate },
95 { "sleep_for", sSleepFor }, 95 { "block_for", sBlockFor },
96 { "throwing_finalizer", sThrowingFinalizer }, 96 { "throwing_finalizer", sThrowingFinalizer },
97 { nullptr, nullptr } 97 { nullptr, nullptr }
98 }; 98 };