UFO: Alien Invasion
Loading...
Searching...
No Matches
test_ui_level2.cpp File Reference

Test cases for code below client/ui/ when the global UI "engine" is started. More...

Include dependency graph for test_ui_level2.cpp:

Go to the source code of this file.

Data Structures

class  UILevel2Test

Functions

static void TEST_ParseScript (const char *scriptName)
static void UFO_AnalyseTestWindow (const char *windowName)
 after execution of a unittest window, it analyse color of normalized indicator, and create asserts. Both Fail/Pass asserts is useful to count number.
static void UFO_ExecuteTestWindow (const char *windowName)
 Parse and execute a test windows.
 TEST_F (UILevel2Test, KnownBehaviours)
 test behaviour name
 TEST_F (UILevel2Test, Actions)
 test actions
 TEST_F (UILevel2Test, Actions2)
 test actions
 TEST_F (UILevel2Test, Conditions)
 test conditions
 TEST_F (UILevel2Test, Functions)
 test function
 TEST_F (UILevel2Test, Setters)
 test setters
 TEST_F (UILevel2Test, Cvars)
 test cvars
 TEST_F (UILevel2Test, Components)
 test components
 TEST_F (UILevel2Test, InheritedConfunc)
 test inherited confunc
 TEST_F (UILevel2Test, RuntimeError)
 test some runtime errors
 TEST_F (UILevel2Test, Video)
 test video nodes but ATM we only check it dont crash
 TEST_F (UILevel2Test, CvarListener)
 test cvarlistener nodes but ATM we only check it dont crash
 TEST_F (UILevel2Test, Binding)
 test key binding
 TEST_F (UILevel2Test, Samples)
 test if we can parse all samples

Detailed Description

Test cases for code below client/ui/ when the global UI "engine" is started.

Definition in file test_ui_level2.cpp.

Function Documentation

◆ TEST_F() [1/14]

TEST_F ( UILevel2Test ,
Actions  )

test actions

Definition at line 163 of file test_ui_level2.cpp.

References UFO_ExecuteTestWindow().

◆ TEST_F() [2/14]

TEST_F ( UILevel2Test ,
Actions2  )

test actions

Definition at line 171 of file test_ui_level2.cpp.

References UFO_ExecuteTestWindow().

◆ TEST_F() [3/14]

TEST_F ( UILevel2Test ,
Binding  )

test key binding

Todo
unfortunately we can't use "bindui" or "press" commands in tests.

Definition at line 260 of file test_ui_level2.cpp.

◆ TEST_F() [4/14]

TEST_F ( UILevel2Test ,
Components  )

test components

Definition at line 211 of file test_ui_level2.cpp.

References UFO_ExecuteTestWindow().

◆ TEST_F() [5/14]

TEST_F ( UILevel2Test ,
Conditions  )

test conditions

Definition at line 179 of file test_ui_level2.cpp.

References UFO_ExecuteTestWindow().

◆ TEST_F() [6/14]

TEST_F ( UILevel2Test ,
CvarListener  )

test cvarlistener nodes but ATM we only check it dont crash

Definition at line 251 of file test_ui_level2.cpp.

References UFO_ExecuteTestWindow().

◆ TEST_F() [7/14]

TEST_F ( UILevel2Test ,
Cvars  )

test cvars

Definition at line 203 of file test_ui_level2.cpp.

References UFO_ExecuteTestWindow().

◆ TEST_F() [8/14]

TEST_F ( UILevel2Test ,
Functions  )

test function

Definition at line 187 of file test_ui_level2.cpp.

References UFO_ExecuteTestWindow().

◆ TEST_F() [9/14]

TEST_F ( UILevel2Test ,
InheritedConfunc  )

test inherited confunc

Todo
extend the text with inherited confunc from window (and not only from component)

Definition at line 220 of file test_ui_level2.cpp.

References TEST_ParseScript(), and UFO_ExecuteTestWindow().

◆ TEST_F() [10/14]

TEST_F ( UILevel2Test ,
KnownBehaviours  )

test behaviour name

Definition at line 138 of file test_ui_level2.cpp.

References uiBehaviour_t::name, and UI_GetNodeBehaviour().

◆ TEST_F() [11/14]

TEST_F ( UILevel2Test ,
RuntimeError  )

test some runtime errors

Todo
when it is possible, we should check error message but ATM we only check it dont crash

Definition at line 233 of file test_ui_level2.cpp.

References UFO_ExecuteTestWindow().

◆ TEST_F() [12/14]

TEST_F ( UILevel2Test ,
Samples  )

test if we can parse all samples

Definition at line 268 of file test_ui_level2.cpp.

References TEST_ParseScript().

◆ TEST_F() [13/14]

TEST_F ( UILevel2Test ,
Setters  )

test setters

Definition at line 195 of file test_ui_level2.cpp.

References UFO_ExecuteTestWindow().

◆ TEST_F() [14/14]

TEST_F ( UILevel2Test ,
Video  )

test video nodes but ATM we only check it dont crash

Definition at line 242 of file test_ui_level2.cpp.

References UFO_ExecuteTestWindow().

◆ TEST_ParseScript()

void TEST_ParseScript ( const char * scriptName)
static
Todo
move it somewhere

Definition at line 51 of file test_ui_level2.cpp.

References CL_ParseClientData(), Com_Printf(), FS_BuildFileList(), FS_NextScriptHeader(), name, and type.

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

◆ UFO_AnalyseTestWindow()

void UFO_AnalyseTestWindow ( const char * windowName)
static

after execution of a unittest window, it analyse color of normalized indicator, and create asserts. Both Fail/Pass asserts is useful to count number.

Note
Useful to count number of tests

Definition at line 76 of file test_ui_level2.cpp.

References uiNode_t::behaviour, uiNode_t::color, uiNode_t::firstChild, uiNode_t::invis, uiNode_t::name, uiNode_t::next, Q_strstart(), UI_GetNodeBehaviour(), UI_GetWindow(), and va().

Referenced by UFO_ExecuteTestWindow().

◆ UFO_ExecuteTestWindow()

void UFO_ExecuteTestWindow ( const char * windowName)
static

Parse and execute a test windows.

Definition at line 115 of file test_ui_level2.cpp.

References Cbuf_Execute(), Cmd_ExecuteString(), Com_Printf(), i, TEST_ParseScript(), UFO_AnalyseTestWindow(), and va().

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