MCPcopy Create free account
hub / github.com/OpenMW/openmw / SetUp

Method SetUp

apps/components_tests/lua/testasync.cpp:14–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12 struct LuaCoroutineCallbackTest : Test
13 {
14 void SetUp() override
15 {
16 mLua.protectedCall([&](LuaUtil::LuaView& view) {
17 sol::table hiddenData(view.sol(), sol::create);
18 hiddenData[LuaUtil::ScriptsContainer::sScriptIdKey] = LuaUtil::ScriptId{};
19 view.sol()["async"] = LuaUtil::getAsyncPackageInitializer(
20 view.sol(), []() { return 0.; }, []() { return 0.; })(hiddenData);
21 view.sol()["pass"] = [&](const sol::table& t) { mCb = LuaUtil::Callback::fromLua(t); };
22 });
23 }
24
25 LuaUtil::LuaState mLua{ nullptr, nullptr };
26 LuaUtil::Callback mCb;

Callers

nothing calls this directly

Calls 3

solMethod · 0.80
protectedCallMethod · 0.45

Tested by

no test coverage detected