1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-27 17:28:41 +00:00

Unittest: Add inventory callback tests

This commit is contained in:
SmallJoker 2022-09-29 22:16:29 +02:00 committed by SmallJoker
parent 4245a7604b
commit 61a5733692
7 changed files with 187 additions and 41 deletions

View file

@ -40,8 +40,9 @@ public:
m_env = env;
}
Inventory *getInventory(const InventoryLocation &loc);
void setInventoryModified(const InventoryLocation &loc);
// virtual: Overwritten by MockInventoryManager for the unittests
virtual Inventory *getInventory(const InventoryLocation &loc);
virtual void setInventoryModified(const InventoryLocation &loc);
// Creates or resets inventory
Inventory *createDetachedInventory(const std::string &name, IItemDefManager *idef,
@ -52,7 +53,7 @@ public:
void sendDetachedInventories(const std::string &peer_name, bool incremental,
std::function<void(const std::string &, Inventory *)> apply_cb);
private:
protected:
struct DetachedInventory
{
std::unique_ptr<Inventory> inventory;