#include "CUnit/Basic.h"
#include "test_inventory.h"
#include "test_shared.h"
#include "../common/common.h"
#include "../game/inventory.h"
Go to the source code of this file.
Functions | |
static void | FreeInventory (void *data) |
static void * | AllocInventoryMemory (size_t size) |
static void | FreeAllInventory (void) |
static void | ResetInventoryList (void) |
static int | UFO_InitSuiteInventory (void) |
static int | UFO_CleanSuiteInventory (void) |
static void | testItemAdd (void) |
static void | testItemDel (void) |
static void | testItemMove (void) |
static qboolean | testAddSingle (inventory_t *inv, objDef_t *od, invDef_t *container) |
static void | testItemMassActions (void) |
int | UFO_AddInventoryTests (void) |
Variables | |
static inventoryInterface_t | i |
static const int | TAG_INVENTORY = 5546 |
static const inventoryImport_t | inventoryImport = { FreeInventory, FreeAllInventory, AllocInventoryMemory } |
Definition in file test_inventory.c.
static void* AllocInventoryMemory | ( | size_t | size | ) | [static] |
Definition at line 40 of file test_inventory.c.
References com_genericPool, Mem_PoolAlloc, and TAG_INVENTORY.
static void FreeAllInventory | ( | void | ) | [static] |
Definition at line 45 of file test_inventory.c.
References com_genericPool, Mem_FreeTag, and TAG_INVENTORY.
static void FreeInventory | ( | void * | data | ) | [static] |
Definition at line 35 of file test_inventory.c.
References Mem_Free.
static void ResetInventoryList | ( | void | ) | [inline, static] |
Definition at line 52 of file test_inventory.c.
References csi, INV_DestroyInventory(), and INV_InitInventory().
Referenced by testItemAdd(), testItemDel(), testItemMassActions(), and testItemMove().
static qboolean testAddSingle | ( | inventory_t * | inv, | |
objDef_t * | od, | |||
invDef_t * | container | |||
) | [static] |
Definition at line 180 of file test_inventory.c.
References item_s::a, item_s::m, item_s::t, and inventoryInterface_s::TryAddToInventory.
Referenced by testItemMassActions().
static void testItemAdd | ( | void | ) | [static] |
Definition at line 81 of file test_inventory.c.
References item_s::a, inventoryInterface_s::AddToInventory, INVSH_ExistsInInventory(), INVSH_GetInventoryDefinitionByID(), INVSH_GetItemByIDSilent(), item_s::m, NONE, qfalse, qtrue, ResetInventoryList(), and item_s::t.
Referenced by UFO_AddInventoryTests().
static void testItemDel | ( | void | ) | [static] |
Definition at line 109 of file test_inventory.c.
References item_s::a, inventoryInterface_s::AddToInventory, INVSH_ExistsInInventory(), INVSH_GetInventoryDefinitionByID(), INVSH_GetItemByIDSilent(), item_s::m, NONE, qfalse, qtrue, inventoryInterface_s::RemoveFromInventory, ResetInventoryList(), and item_s::t.
Referenced by UFO_AddInventoryTests().
static void testItemMassActions | ( | void | ) | [static] |
Definition at line 191 of file test_inventory.c.
References objDef_s::ammos, csi, INVSH_GetInventoryDefinitionByID(), INVSH_GetItemByIDSilent(), INVSH_GetItemByIDX(), objDef_s::numAmmos, csi_s::numODs, qfalse, qtrue, ResetInventoryList(), and testAddSingle().
Referenced by UFO_AddInventoryTests().
static void testItemMove | ( | void | ) | [static] |
Definition at line 142 of file test_inventory.c.
References item_s::a, inventoryInterface_s::AddToInventory, IA_MOVE, INVSH_ExistsInInventory(), INVSH_GetInventoryDefinitionByID(), INVSH_GetItemByIDSilent(), item_s::m, inventoryInterface_s::MoveInInventory, NONE, qfalse, qtrue, ResetInventoryList(), and item_s::t.
Referenced by UFO_AddInventoryTests().
int UFO_AddInventoryTests | ( | void | ) |
Definition at line 255 of file test_inventory.c.
References testItemAdd(), testItemDel(), testItemMassActions(), testItemMove(), UFO_CleanSuiteInventory(), and UFO_InitSuiteInventory().
static int UFO_CleanSuiteInventory | ( | void | ) | [static] |
The suite cleanup function. Returns zero on success, non-zero otherwise.
Definition at line 75 of file test_inventory.c.
References TEST_Shutdown().
Referenced by UFO_AddInventoryTests().
static int UFO_InitSuiteInventory | ( | void | ) | [static] |
The suite initialization function. Returns zero on success, non-zero otherwise.
Definition at line 62 of file test_inventory.c.
References Com_ParseScripts(), qfalse, and TEST_Init().
Referenced by UFO_AddInventoryTests().
inventoryInterface_t i [static] |
Definition at line 32 of file test_inventory.c.
const inventoryImport_t inventoryImport = { FreeInventory, FreeAllInventory, AllocInventoryMemory } [static] |
Definition at line 50 of file test_inventory.c.
const int TAG_INVENTORY = 5546 [static] |
Definition at line 33 of file test_inventory.c.
Referenced by AllocInventoryMemory(), and FreeAllInventory().