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

Function TEST_F

apps/components_tests/lua/testlua.cpp:100–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98 };
99
100 TEST_F(LuaStateTest, Sandbox)
101 {
102 const VFS::Path::Normalized path(counterPath);
103 sol::table script1 = mLua.runInNewSandbox(path);
104
105 EXPECT_EQ(LuaUtil::call(script1["get"]).get<int>(), 42);
106 LuaUtil::call(script1["inc"], 3);
107 EXPECT_EQ(LuaUtil::call(script1["get"]).get<int>(), 45);
108
109 sol::table script2 = mLua.runInNewSandbox(path);
110 EXPECT_EQ(LuaUtil::call(script2["get"]).get<int>(), 42);
111 LuaUtil::call(script2["inc"], 1);
112 EXPECT_EQ(LuaUtil::call(script2["get"]).get<int>(), 43);
113
114 EXPECT_EQ(LuaUtil::call(script1["get"]).get<int>(), 45);
115 }
116
117 TEST_F(LuaStateTest, ToString)
118 {

Callers

nothing calls this directly

Calls 15

make_objectFunction · 0.85
getMutableFromReadOnlyFunction · 0.85
makeReadOnlyFunction · 0.85
getLuaVersionFunction · 0.85
safeGetFunction · 0.85
runInNewSandboxMethod · 0.80
unsafeStateMethod · 0.80
create_table_withMethod · 0.80
solMethod · 0.80
addCommonPackageMethod · 0.80
getTotalMemoryUsageMethod · 0.80
callFunction · 0.50

Tested by

no test coverage detected