UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
test_ui_level2.cpp File Reference

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

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. More...
 
static void UFO_ExecuteTestWindow (const char *windowName)
 Parse and execute a test windows. More...
 
 TEST_F (UILevel2Test, KnownBehaviours)
 test behaviour name More...
 
 TEST_F (UILevel2Test, Actions)
 test actions More...
 
 TEST_F (UILevel2Test, Actions2)
 test actions More...
 
 TEST_F (UILevel2Test, Conditions)
 test conditions More...
 
 TEST_F (UILevel2Test, Functions)
 test function More...
 
 TEST_F (UILevel2Test, Setters)
 test setters More...
 
 TEST_F (UILevel2Test, Cvars)
 test cvars More...
 
 TEST_F (UILevel2Test, Components)
 test components More...
 
 TEST_F (UILevel2Test, InheritedConfunc)
 test inherited confunc More...
 
 TEST_F (UILevel2Test, RuntimeError)
 test some runtime errors More...
 
 TEST_F (UILevel2Test, Video)
 test video nodes but ATM we only check it dont crash More...
 
 TEST_F (UILevel2Test, CvarListener)
 test cvarlistener nodes but ATM we only check it dont crash More...
 
 TEST_F (UILevel2Test, Binding)
 test key binding More...
 
 TEST_F (UILevel2Test, Samples)
 test if we can parse all samples More...
 

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 ( UILevel2Test  ,
KnownBehaviours   
)

test behaviour name

Definition at line 138 of file test_ui_level2.cpp.

References uiBehaviour_t::name, and UI_GetNodeBehaviour().

TEST_F ( UILevel2Test  ,
Actions   
)

test actions

Definition at line 163 of file test_ui_level2.cpp.

References UFO_ExecuteTestWindow().

TEST_F ( UILevel2Test  ,
Actions2   
)

test actions

Definition at line 171 of file test_ui_level2.cpp.

References UFO_ExecuteTestWindow().

TEST_F ( UILevel2Test  ,
Conditions   
)

test conditions

Definition at line 179 of file test_ui_level2.cpp.

References UFO_ExecuteTestWindow().

TEST_F ( UILevel2Test  ,
Functions   
)

test function

Definition at line 187 of file test_ui_level2.cpp.

References UFO_ExecuteTestWindow().

TEST_F ( UILevel2Test  ,
Setters   
)

test setters

Definition at line 195 of file test_ui_level2.cpp.

References UFO_ExecuteTestWindow().

TEST_F ( UILevel2Test  ,
Cvars   
)

test cvars

Definition at line 203 of file test_ui_level2.cpp.

References UFO_ExecuteTestWindow().

TEST_F ( UILevel2Test  ,
Components   
)

test components

Definition at line 211 of file test_ui_level2.cpp.

References UFO_ExecuteTestWindow().

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 ( 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 ( 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_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 ( 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 ( UILevel2Test  ,
Samples   
)

test if we can parse all samples

Definition at line 268 of file test_ui_level2.cpp.

References TEST_ParseScript().

static 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(), and UFO_ExecuteTestWindow().

static 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().

static 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().