mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Increase safety checks around ObjectRefs
This commit is contained in:
parent
41091a147c
commit
c8dc9c2b8d
6 changed files with 27 additions and 12 deletions
|
@ -68,6 +68,8 @@ void TestMoveAction::runTests(IGameDef *gamedef)
|
|||
auto null_map = std::unique_ptr<ServerMap>();
|
||||
ServerEnvironment server_env(std::move(null_map), &server, &mb);
|
||||
MockServerActiveObject obj(&server_env);
|
||||
obj.setId(1);
|
||||
server.getScriptIface()->addObjectReference(&obj);
|
||||
|
||||
TEST(testMove, &obj, gamedef);
|
||||
TEST(testMoveFillStack, &obj, gamedef);
|
||||
|
@ -82,6 +84,8 @@ void TestMoveAction::runTests(IGameDef *gamedef)
|
|||
|
||||
TEST(testCallbacks, &obj, &server);
|
||||
TEST(testCallbacksSwap, &obj, &server);
|
||||
|
||||
server.getScriptIface()->removeObjectReference(&obj);
|
||||
}
|
||||
|
||||
static ItemStack parse_itemstack(const char *s)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue