DayZ 1.24
Loading...
Searching...
No Matches
ScriptInvokerTests Class Reference
Inheritance diagram for ScriptInvokerTests:
[legend]
Collaboration diagram for ScriptInvokerTests:
[legend]

Private Member Functions

void ScriptInvokerTests ()
 
void ~ScriptInvokerTests ()
 
TFResult TestFirstUnique ()
 
TFResult TestSecondUnique ()
 
TFResult TestInsertRemoveUnique ()
 
TFResult TestInsertUniqueImmediate ()
 
TFResult TestClearRunning ()
 
TFResult TestInvokeRunning ()
 
TFResult TestInsertRunning ()
 
void InvokeLog (string s)
 
void InvokeReset ()
 
void InvokeClear (string s)
 
void InvokeInvoke (string s)
 
void InvokeInsert (string s)
 

Private Attributes

ref ScriptInvoker m_Invoker
 
int m_InvokeCount
 

Detailed Description

Definition at line 1 of file ScriptInvokerTests.c.

Constructor & Destructor Documentation

◆ ScriptInvokerTests()

void ScriptInvokerTests::ScriptInvokerTests ( )
inlineprivate

Definition at line 9 of file ScriptInvokerTests.c.

10 {
12
13 //AddInitTest("TestFirstUnique");
14 //AddInitTest("TestSecondUnique");
15 //AddInitTest("TestInsertRemoveUnique");
16 //AddInitTest("TestInsertUniqueImmediate");
17 //AddInitTest("TestClearRunning");
18 //AddInitTest("TestInvokeRunning");
19 AddInitTest("TestInsertRunning");
20 }
void AddInitTest(string test)
ScriptInvoker Class provide list of callbacks usage:
Definition tools.c:116
ref ScriptInvoker m_Invoker

References AddInitTest(), and m_Invoker.

◆ ~ScriptInvokerTests()

void ScriptInvokerTests::~ScriptInvokerTests ( )
inlineprivate

Definition at line 25 of file ScriptInvokerTests.c.

26 {
27
28 }

Member Function Documentation

◆ InvokeClear()

void ScriptInvokerTests::InvokeClear ( string s)
inlineprivate

Definition at line 175 of file ScriptInvokerTests.c.

176 {
177 InvokeLog(s);
178 m_Invoker.Clear();
179 }

References InvokeLog(), and m_Invoker.

Referenced by TestClearRunning().

◆ InvokeInsert()

void ScriptInvokerTests::InvokeInsert ( string s)
inlineprivate

Definition at line 187 of file ScriptInvokerTests.c.

188 {
189 InvokeLog(s);
191 }
EScriptInvokerInsertFlags
Definition tools.c:130
void InvokeInsert(string s)

References InvokeInsert(), InvokeLog(), and m_Invoker.

Referenced by InvokeInsert(), and TestInsertRunning().

◆ InvokeInvoke()

void ScriptInvokerTests::InvokeInvoke ( string s)
inlineprivate

Definition at line 181 of file ScriptInvokerTests.c.

182 {
183 InvokeLog(s);
184 m_Invoker.Invoke(s);
185 }

References InvokeLog(), and m_Invoker.

Referenced by TestInvokeRunning().

◆ InvokeLog()

void ScriptInvokerTests::InvokeLog ( string s)
inlineprivate

Definition at line 163 of file ScriptInvokerTests.c.

164 {
165 //Debug.TFLog(s, this, "InvokeLog");
167 }

References m_InvokeCount.

Referenced by InvokeClear(), InvokeInsert(), InvokeInvoke(), TestClearRunning(), TestFirstUnique(), TestInsertRemoveUnique(), TestInsertUniqueImmediate(), and TestSecondUnique().

◆ InvokeReset()

void ScriptInvokerTests::InvokeReset ( )
inlineprivate

◆ TestClearRunning()

TFResult ScriptInvokerTests::TestClearRunning ( )
inlineprivate

Definition at line 112 of file ScriptInvokerTests.c.

113 {
114 InvokeReset();
115
116 m_Invoker.Insert(InvokeClear);
117 m_Invoker.Insert(InvokeLog);
118
119 m_Invoker.Invoke("TestClearRunning");
120 bool count = Assert(m_InvokeCount == 1);
121
122 InvokeReset();
123
124 return BTFR(count);
125 }
bool Assert(bool condition)
TFResult BTFR(bool result)
void InvokeClear(string s)

References Assert(), BTFR(), InvokeClear(), InvokeLog(), InvokeReset(), m_InvokeCount, and m_Invoker.

◆ TestFirstUnique()

TFResult ScriptInvokerTests::TestFirstUnique ( )
inlineprivate

Definition at line 34 of file ScriptInvokerTests.c.

35 {
37
40 bool insert2 = m_Invoker.Insert(InvokeLog);
42
43 m_Invoker.Invoke("TestFirstUnique");
44 bool count = Assert(m_InvokeCount == 1);
45
47
48 return BTFR(insert1 && !insert2 && count);
49 }

References Assert(), BTFR(), InvokeLog(), InvokeReset(), m_InvokeCount, and m_Invoker.

◆ TestInsertRemoveUnique()

TFResult ScriptInvokerTests::TestInsertRemoveUnique ( )
inlineprivate

Definition at line 72 of file ScriptInvokerTests.c.

73 {
75
78 bool remove1 = m_Invoker.Remove(InvokeLog);
80 bool insert2 = m_Invoker.Insert(InvokeLog);
82
83 m_Invoker.Invoke("TestInsertRemoveUnique");
84 bool count = Assert(m_InvokeCount == 1);
85
87
88 return BTFR(insert1 && remove1 && insert2 && count);
89 }

References Assert(), BTFR(), InvokeLog(), InvokeReset(), m_InvokeCount, and m_Invoker.

◆ TestInsertRunning()

TFResult ScriptInvokerTests::TestInsertRunning ( )
inlineprivate

Definition at line 144 of file ScriptInvokerTests.c.

145 {
146 InvokeReset();
147
148 m_Invoker.Insert(InvokeInsert);
149
150 m_Invoker.Invoke("TestInvokeRunning");
152 bool count = Assert(m_InvokeCount == 129);
153
154 InvokeReset();
155
156 return BTFR(count);
157 }
proto void Print(void var)
Prints content of variable to console/log.

References Assert(), BTFR(), InvokeInsert(), InvokeReset(), m_InvokeCount, m_Invoker, and Print().

◆ TestInsertUniqueImmediate()

TFResult ScriptInvokerTests::TestInsertUniqueImmediate ( )
inlineprivate

Definition at line 93 of file ScriptInvokerTests.c.

94 {
96
99 bool insert2 = m_Invoker.Insert(InvokeLog, EScriptInvokerInsertFlags.IMMEDIATE);
101
102 m_Invoker.Invoke("TestInsertUniqueImmediate");
103 bool count = Assert(m_InvokeCount == 1);
104
105 InvokeReset();
106
107 return BTFR(insert1 && !insert2 && count);
108 }

References Assert(), BTFR(), InvokeLog(), InvokeReset(), m_InvokeCount, and m_Invoker.

◆ TestInvokeRunning()

TFResult ScriptInvokerTests::TestInvokeRunning ( )
inlineprivate

Definition at line 129 of file ScriptInvokerTests.c.

130 {
131 InvokeReset();
132
133 m_Invoker.Insert(InvokeInvoke);
134
135 m_Invoker.Invoke("TestInvokeRunning");
136
137 InvokeReset();
138
139 return BTFR(false); // This can never succeed, it will never even reach this point
140 }
void InvokeInvoke(string s)

References BTFR(), InvokeInvoke(), InvokeReset(), and m_Invoker.

◆ TestSecondUnique()

TFResult ScriptInvokerTests::TestSecondUnique ( )
inlineprivate

Definition at line 53 of file ScriptInvokerTests.c.

54 {
56
57 bool insert1 = m_Invoker.Insert(InvokeLog);
61
62 m_Invoker.Invoke("TestSecondUnique");
63 bool count = Assert(m_InvokeCount == 1);
64
66
67 return BTFR(insert1 && !insert2 && count);
68 }

References Assert(), BTFR(), InvokeLog(), InvokeReset(), m_InvokeCount, and m_Invoker.

Member Data Documentation

◆ m_InvokeCount

◆ m_Invoker


The documentation for this class was generated from the following file: