| 49 | std::mutex lua_value_construct_require_mutex; |
| 50 | |
| 51 | void lua_value_construct_race() { |
| 52 | sol::state lua; |
| 53 | try { |
| 54 | lua.open_libraries(); |
| 55 | lua["a"] = sol::lua_value(lua, 24); |
| 56 | int a = lua["a"]; |
| 57 | { |
| 58 | std::lock_guard<std::mutex> lg(lua_value_construct_require_mutex); |
| 59 | REQUIRE(a == 24); |
| 60 | } |
| 61 | } |
| 62 | catch (const sol::error& e) { |
| 63 | std::lock_guard<std::mutex> lg(lua_value_construct_require_mutex); |
| 64 | INFO(e.what()); |
| 65 | REQUIRE(false); |
| 66 | } |
| 67 | catch (...) { |
| 68 | std::lock_guard<std::mutex> lg(lua_value_construct_require_mutex); |
| 69 | REQUIRE(false); |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | TEST_CASE("lua_value/nested", "make nested values can be put in lua_value properly") { |
| 74 | #if SOL_IS_ON(SOL_STD_VARIANT) |
nothing calls this directly
no test coverage detected