UFO: Alien Invasion
Loading...
Searching...
No Matches
test_shared.h File Reference
#include <gtest/gtest.h>
#include "../common/common.h"
#include "../shared/shared.h"
Include dependency graph for test_shared.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void TEST_vPrintf (const char *fmt, va_list argptr)
void TEST_vPrintfSilent (const char *fmt, va_list argptr)
void TEST_Init (void)
void TEST_Shutdown (void)
void TEST_RegisterProperty (const char *name, const char *value)
bool TEST_ExistsProperty (const char *name)
int TEST_GetIntProperty (const char *name)
long TEST_GetLongProperty (const char *name)
const char * TEST_GetStringProperty (const char *name)

Function Documentation

◆ TEST_ExistsProperty()

bool TEST_ExistsProperty ( const char * name)

Test if a property from global test structure exists

Parameters
nameName of the property
Returns
True if the property exists

Definition at line 175 of file test_shared.cpp.

References name, and TEST_GetProperty().

Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), GameTest::testCountSpawnpointsForMap(), GameTest::testCountSpawnpointsForMapWithAssembly(), GameTest::testCountSpawnpointsForMapWithAssemblyAndAircraft(), and GameTest::testCountSpawnpointsForMapWithAssemblyAndAircraftAndUfo().

◆ TEST_GetIntProperty()

int TEST_GetIntProperty ( const char * name)

Get a property value from global test structure

Parameters
nameName of the property
Returns
A property value, else 0 if property not found.

Definition at line 200 of file test_shared.cpp.

References Com_Printf(), name, TEST_GetProperty(), and test_property_t::value.

◆ TEST_GetLongProperty()

long TEST_GetLongProperty ( const char * name)

Get a property value from global test structure

Parameters
nameName of the property
Returns
A property value, else 0 if property not found.

Definition at line 215 of file test_shared.cpp.

References Com_Printf(), name, TEST_GetProperty(), and test_property_t::value.

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

◆ TEST_GetStringProperty()

const char * TEST_GetStringProperty ( const char * name)

◆ TEST_Init()

◆ TEST_RegisterProperty()

void TEST_RegisterProperty ( const char * name,
const char * value )

interface to allow to custom tests with command line

Register a property name-value to a global structure for all tests

Parameters
nameName of the property
valueValue of the property. Only the pointer of the value is used. Use it ONLY with stable memory.

TODO maybe copy the value instead of copying the pointer of the value

Definition at line 125 of file test_shared.cpp.

References Com_HashKey(), Com_Printf(), hash, test_property_t::hash_next, name, test_property_t::name, test_property_t::next, PROPERTY_HASH_SIZE, Q_streq, Q_strncpyz(), test_property, test_property_hash, and test_property_t::value.

Referenced by Test_Parameters().

◆ TEST_Shutdown()

◆ TEST_vPrintf()

void TEST_vPrintf ( const char * fmt,
va_list argptr )

Definition at line 62 of file test_shared.cpp.

References Q_vsnprintf().

Referenced by main().

◆ TEST_vPrintfSilent()

void TEST_vPrintfSilent ( const char * fmt,
va_list argptr )

Definition at line 58 of file test_shared.cpp.

Referenced by main().