DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл PMTCreationAndCleanup.c

См. исходные тексты.

Структуры данных

class  OwnershipTestDummyClass
 

Функции

void PMTCreationAndCleanup ()
 
TFResult TestInvalidSize ()
 
TFResult TestCCSB ()
 
TFResult TestEvents ()
 
TFResult TestOwnership ()
 
TFResult CheckTestEvents ()
 
void PassCheckEvents (ParticleManager pm)
 
TFResult TestCreationSmallBlocking (int size, bool enableAsserts=true)
 
TFResult TestCleanup (string f, int p1=0)
 
TFResult TestMultiCreation (int instances)
 

Переменные

class OwnershipTestDummyClass m_EventTestManagerID
 
bool m_bTestEventsPassed = false
 
int m_OwnershipTestManagerID
 

Функции

◆ CheckTestEvents()

TFResult CheckTestEvents ( )
95 {
98 {
99 if (pm)
100 {
101 if (pm.IsFinishedAllocating())
102 {
104 }
105 }
106 else
107 {
108 return BTFR(Assert(false));
109 }
110 }
111 else
112 {
113 return BTFR(Assert(false));
114 }
115
116 return NTFR(TFR.PENDING);
117 }
class OwnershipTestDummyClass m_EventTestManagerID
bool m_bTestEventsPassed
Definition PMTCreationAndCleanup.c:9
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
Definition ParticleManager.c:84
PlayerStats GetManager()
Definition PlayerStatBase.c:201
TFResult NTFR(TFR result)
Definition TestFramework.c:273
bool Assert(bool condition)
Definition TestFramework.c:262
TFR
Definition TestFramework.c:2
TFResult BTFR(bool result)
Definition TestFramework.c:278
Definition EntityAI.c:95

Перекрестные ссылки Assert(), BTFR(), GetManager(), m_bTestEventsPassed, m_EventTestManagerID, NTFR() и ParticleManager().

◆ PassCheckEvents()

void PassCheckEvents ( ParticleManager pm)
123 {
124 Assert(pm.IsFinishedAllocating());
125 m_bTestEventsPassed = true;
126 }

Перекрестные ссылки Assert() и m_bTestEventsPassed.

Используется в TestEvents().

◆ PMTCreationAndCleanup()

void PMTCreationAndCleanup ( )
17 {
18 //AddInitTest("TestInvalidSize");
19 AddInitTest("TestCCSB");
20 AddInitTest("TestEvents");
21 AddInitTest("TestOwnership");
22 }
void AddInitTest(string test)
Definition TestFramework.c:249

Перекрестные ссылки AddInitTest().

◆ TestCCSB()

TFResult TestCCSB ( )
42 {
43 return TestCleanup("TestMultiCreation", 3000);
44 }
TFResult TestCleanup(string f, int p1=0)
Definition PMTCreationAndCleanup.c:149

Перекрестные ссылки TestCleanup().

◆ TestCleanup()

TFResult TestCleanup ( string f,
int p1 = 0 )
150 {
151 int pmTotal = ParticleManager.GetStaticActiveCount();
153
154 PrintActiveStats();
155
156 TFResult res = CTFR();
157
158 GetGame().GameScript.CallFunction(this, f, res, p1);
159
160 int pmTotalPost = ParticleManager.GetStaticActiveCount();
162
163 PrintActiveStats();
164
167
168 return res.And(BTFR(success));
169 }
TFResult CTFR()
Definition TestFramework.c:286
void TFResult(TFR result)
Definition TestFramework.c:12
Entity which has the particle instance as an ObjectComponent.
Definition ParticleSource.c:124
proto static native int GetStaticActiveCount()
Gets the amount of ParticleSource that are currently existing.
proto native CGame GetGame()

Перекрестные ссылки Assert(), BTFR(), CTFR(), GetGame(), ParticleSource::GetStaticActiveCount(), ParticleManager(), PMTF::PrintActiveStats() и TFResult().

Используется в TestCCSB().

◆ TestCreationSmallBlocking()

TFResult TestCreationSmallBlocking ( int size,
bool enableAsserts = true )
132 {
133 // Blocking, so that we can test AllocatedCount
134 ParticleManager pm = CreatePMFixedBlocking(size);
135 PrintPMStats(pm);
136
137 bool success = true;
138
139 if (enableAsserts)
140 {
141 success &= Assert(pm.GetPoolSize() == size);
142 success &= Assert(pm.GetAllocatedCount() == size);
143 success &= Assert(pm.GetEvents() != null);
144 }
145
146 return BTFR(success);
147 }

Перекрестные ссылки Assert(), BTFR(), PMTF::CreatePMFixedBlocking(), ParticleManager() и PMTF::PrintPMStats().

Используется в TestInvalidSize() и TestMultiCreation().

◆ TestEvents()

TFResult TestEvents ( )
49 {
51 bool success = !pm.IsFinishedAllocating(); // We need it to not be done in the same frame
52 if (Assert(success))
53 {
54 pm.GetEvents().Event_OnAllocationEnd.Insert(PassCheckEvents);
55
56 m_EventTestManagerID = InsertManager(pm);
57 AddFrameTest("CheckTestEvents");
58
59 return NTFR(TFR.SUCCESS);
60 }
61
62 return NTFR(TFR.FAIL);
63 }
void PassCheckEvents(ParticleManager pm)
Definition PMTCreationAndCleanup.c:122
class ParticleManagerConstants ParticleManagerSettings(int poolSize, int flags=ParticleManagerSettingsFlags.NONE)
Settings given to ParticleManager on creation (in ctor)
Definition ParticleManager.c:35
void AddFrameTest(string test)
Definition TestFramework.c:254

Перекрестные ссылки AddFrameTest(), Assert(), PMTF::InsertManager(), m_EventTestManagerID, NTFR(), ParticleManager(), ParticleManagerSettings() и PassCheckEvents().

◆ TestInvalidSize()

TFResult TestInvalidSize ( )
29 {
30 Debug.ParticleLog("Expecting VME: Invalid size. (0)", this, "TestInvalidSize");
32
33 Debug.ParticleLog("Expecting VME: Invalid size. (-3)", this, "TestInvalidSize");
35
36 return NTFR(TFR.SUCCESS); // No way to check if a VME popped or not...
37 }
TFResult TestCreationSmallBlocking(int size, bool enableAsserts=true)
Definition PMTCreationAndCleanup.c:131
Definition Debug.c:14
static void ParticleLog(string message=LOG_DEFAULT, Managed caller=null, string function="", Managed entity=null)
Definition Debug.c:186

Перекрестные ссылки NTFR(), Debug::ParticleLog() и TestCreationSmallBlocking().

◆ TestMultiCreation()

TFResult TestMultiCreation ( int instances)
172 {
173 TFResult res = CTFR();
174 for (int i = 0; i < instances; ++i)
175 {
177 }
178 return res;
179 }

Перекрестные ссылки CTFR(), TestCreationSmallBlocking() и TFResult().

◆ TestOwnership()

TFResult TestOwnership ( )
68 {
69 ParticleManager pm = CreatePMFixedBlocking(1);
70 bool success = pm.IsFinishedAllocating(); // We need it to be done in the same frame
71 if (Assert(success))
72 {
73 m_OwnershipTestManagerID = InsertManager(pm);
75
76 ParticleProperties pp = new ParticleProperties(GetGame().GetPlayer().GetPosition(), ParticlePropertiesFlags.NONE, null, vector.Zero, dummy);
78
79 bool result = Assert(pm.CreateParticleByPath(particlePath, pp) != null);
80 Debug.ParticleLog("Expecting VME: All particles in pool are already used.", this, "TestOwnership");
81 result &= Assert(pm.CreateParticleByPath(particlePath, pp) == null);
82 delete dummy;
83 result &= Assert(pm.CreateParticleByPath(particlePath, pp) != null);
84
85 return BTFR(result);
86 }
87
88 return NTFR(TFR.FAIL);
89 }
PlayerBase GetPlayer()
Definition ModifierBase.c:51
int m_OwnershipTestManagerID
Definition PMTCreationAndCleanup.c:11
class JsonUndergroundAreaTriggerData GetPosition
Definition UndergroundAreaLoader.c:9
Definition PMTCreationAndCleanup.c:2
Definition ParticleList.c:12
static string GetParticleFullPath(int particle_id)
Returns particle's full path (with .ptc suffix) based on its ID.
Definition ParticleList.c:468
static const int EXPLOSION_LANDMINE
Definition ParticleList.c:257
Definition EnConvert.c:106
static const vector Zero
Definition EnConvert.c:110

Перекрестные ссылки Assert(), BTFR(), PMTF::CreatePMFixedBlocking(), ParticleList::EXPLOSION_LANDMINE, GetGame(), ParticleList::GetParticleFullPath(), GetPlayer(), GetPosition, PMTF::InsertManager(), m_OwnershipTestManagerID, NTFR(), Debug::ParticleLog(), ParticleManager() и vector::Zero.

Переменные

◆ m_bTestEventsPassed

bool m_bTestEventsPassed = false

Используется в CheckTestEvents() и PassCheckEvents().

◆ m_EventTestManagerID

class OwnershipTestDummyClass m_EventTestManagerID

Используется в CheckTestEvents() и TestEvents().

◆ m_OwnershipTestManagerID

int m_OwnershipTestManagerID

Используется в TestOwnership().