UFO: Alien Invasion
test_inventory.cpp File Reference
#include "test_shared.h"
#include "../common/common.h"
#include "../game/inventory.h"
Include dependency graph for test_inventory.cpp:

Go to the source code of this file.

Data Structures

class  InventoryTest
 

Functions

static void FreeInventory (void *data)
 
static voidAllocInventoryMemory (size_t size)
 
static void FreeAllInventory (void)
 
static void ResetInventoryList (void)
 
 TEST_F (InventoryTest, ItemAdd)
 
 TEST_F (InventoryTest, ItemDel)
 
 TEST_F (InventoryTest, ItemMove)
 
 TEST_F (InventoryTest, ItemReload)
 
static bool testAddSingle (Inventory *inv, const objDef_t *od, const invDef_t *container)
 
 TEST_F (InventoryTest, ItemMassActions)
 
 TEST_F (InventoryTest, ItemToHeadgear)
 

Variables

static InventoryInterface i
 
static const int TAG_INVENTORY = 5546
 
static const inventoryImport_t inventoryImport = { FreeInventory, FreeAllInventory, AllocInventoryMemory }
 

Function Documentation

◆ AllocInventoryMemory()

static void * AllocInventoryMemory ( size_t  size)
static

Definition at line 38 of file test_inventory.cpp.

References com_genericPool, Mem_PoolAlloc, and TAG_INVENTORY.

◆ FreeAllInventory()

static void FreeAllInventory ( void  )
static

Definition at line 43 of file test_inventory.cpp.

References com_genericPool, Mem_FreeTag, and TAG_INVENTORY.

◆ FreeInventory()

static void FreeInventory ( void data)
static

Definition at line 33 of file test_inventory.cpp.

References data, and Mem_Free.

◆ ResetInventoryList()

static void ResetInventoryList ( void  )
inlinestatic

◆ TEST_F() [1/6]

◆ TEST_F() [2/6]

◆ TEST_F() [3/6]

◆ TEST_F() [4/6]

◆ TEST_F() [5/6]

◆ TEST_F() [6/6]

◆ testAddSingle()

static bool testAddSingle ( Inventory inv,
const objDef_t od,
const invDef_t container 
)
static

Definition at line 219 of file test_inventory.cpp.

References i, and InventoryInterface::tryAddToInventory().

Referenced by TEST_F().

Variable Documentation

◆ i

Definition at line 30 of file test_inventory.cpp.

Referenced by ResetInventoryList(), TEST_F(), and testAddSingle().

◆ inventoryImport

Definition at line 48 of file test_inventory.cpp.

Referenced by ResetInventoryList().

◆ TAG_INVENTORY

const int TAG_INVENTORY = 5546
static

Definition at line 31 of file test_inventory.cpp.

Referenced by AllocInventoryMemory(), and FreeAllInventory().