aboutsummaryrefslogtreecommitdiff
path: root/unit_tests/shared.cpp
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2025-04-24 18:21:15 +0200
committerBenoit Germain <benoit.germain@ubisoft.com>2025-04-24 18:21:15 +0200
commitfe51e51bb07b1cb662b0d4f972604f56e63f8432 (patch)
tree15684515325a5092433a68f65920b941a645e2aa /unit_tests/shared.cpp
parent0085c2f6d6b5fbc6dd9244ae9b9af5a378ac4126 (diff)
downloadlanes-fe51e51bb07b1cb662b0d4f972604f56e63f8432.tar.gz
lanes-fe51e51bb07b1cb662b0d4f972604f56e63f8432.tar.bz2
lanes-fe51e51bb07b1cb662b0d4f972604f56e63f8432.zip
Unit test fixes
* fix cooperative_shutdown * add a test to tasking_cancelling * fix bad fixture function name give_me_back
Diffstat (limited to '')
-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 };