AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
PeriodicAbsorbStealthProcTest.cpp File Reference
#include "ProcEventInfoHelper.h"
#include "SpellMgr.h"
#include "WorldMock.h"
#include "gtest/gtest.h"
#include "gmock/gmock.h"

Go to the source code of this file.

Classes

class  PeriodicAbsorbStealthProcTest
 Tests for fully absorbed periodic damage not triggering TAKEN procs. More...
 

Functions

 TEST_F (PeriodicAbsorbStealthProcTest, FullyAbsorbedPeriodicDoesNotTriggerTakenProc)
 
 TEST_F (PeriodicAbsorbStealthProcTest, NonAbsorbedPeriodicTriggersTakenProc)
 
 TEST_F (PeriodicAbsorbStealthProcTest, CriticalPeriodicTriggersTakenProc)
 
 TEST_F (PeriodicAbsorbStealthProcTest, PartiallyAbsorbedPeriodicTriggersTakenProc)
 
 TEST_F (PeriodicAbsorbStealthProcTest, FullyAbsorbedPeriodicTriggersDoneProc)
 

Function Documentation

◆ TEST_F() [1/5]

TEST_F ( PeriodicAbsorbStealthProcTest  ,
CriticalPeriodicTriggersTakenProc   
)
105{
106 auto procEntry = SpellProcEntryBuilder()
108 .WithHitMask(0)
109 .Build();
110
111 auto eventInfo = ProcEventInfoBuilder()
114 .Build();
115
116 EXPECT_TRUE(sSpellMgr->CanSpellTriggerProcOnEvent(procEntry, eventInfo));
117}
@ PROC_HIT_CRITICAL
Definition SpellMgr.h:258
#define sSpellMgr
Definition SpellMgr.h:836
@ PROC_FLAG_TAKEN_PERIODIC
Definition SpellMgr.h:138
Builder class for creating ProcEventInfo test instances.
Definition ProcEventInfoHelper.h:31
ProcEventInfoBuilder & WithTypeMask(uint32 typeMask)
Definition ProcEventInfoHelper.h:57
ProcEventInfoBuilder & WithHitMask(uint32 hitMask)
Definition ProcEventInfoHelper.h:75
ProcEventInfo Build()
Definition ProcEventInfoHelper.h:111
Builder class for creating SpellProcEntry test instances.
Definition ProcEventInfoHelper.h:141
SpellProcEntryBuilder & WithHitMask(uint32 hitMask)
Definition ProcEventInfoHelper.h:184
SpellProcEntry Build() const
Definition ProcEventInfoHelper.h:226
SpellProcEntryBuilder & WithProcFlags(uint32 procFlags)
Definition ProcEventInfoHelper.h:166

References ProcEventInfoBuilder::Build(), SpellProcEntryBuilder::Build(), PROC_FLAG_TAKEN_PERIODIC, PROC_HIT_CRITICAL, sSpellMgr, ProcEventInfoBuilder::WithHitMask(), SpellProcEntryBuilder::WithHitMask(), SpellProcEntryBuilder::WithProcFlags(), and ProcEventInfoBuilder::WithTypeMask().

◆ TEST_F() [2/5]

TEST_F ( PeriodicAbsorbStealthProcTest  ,
FullyAbsorbedPeriodicDoesNotTriggerTakenProc   
)
68{
69 // Stealth has ProcFlags including PROC_FLAG_TAKEN_PERIODIC, HitMask=0
70 // Default TAKEN HitMask = PROC_HIT_NORMAL | PROC_HIT_CRITICAL (no ABSORB)
71 auto procEntry = SpellProcEntryBuilder()
73 .WithHitMask(0)
74 .Build();
75
76 // Fully absorbed periodic tick: hitMask = PROC_HIT_ABSORB only
77 // (damage=0 so PROC_EX_NORMAL_HIT is NOT set)
78 auto eventInfo = ProcEventInfoBuilder()
81 .Build();
82
83 EXPECT_FALSE(sSpellMgr->CanSpellTriggerProcOnEvent(procEntry, eventInfo));
84}
@ PROC_HIT_ABSORB
Definition SpellMgr.h:267

References ProcEventInfoBuilder::Build(), SpellProcEntryBuilder::Build(), PROC_FLAG_TAKEN_PERIODIC, PROC_HIT_ABSORB, sSpellMgr, ProcEventInfoBuilder::WithHitMask(), SpellProcEntryBuilder::WithHitMask(), SpellProcEntryBuilder::WithProcFlags(), and ProcEventInfoBuilder::WithTypeMask().

◆ TEST_F() [3/5]

TEST_F ( PeriodicAbsorbStealthProcTest  ,
FullyAbsorbedPeriodicTriggersDoneProc   
)
140{
141 auto procEntry = SpellProcEntryBuilder()
144 .WithHitMask(0)
145 .Build();
146
147 // Fully absorbed: only PROC_HIT_ABSORB
148 auto eventInfo = ProcEventInfoBuilder()
152 .Build();
153
154 // DONE default includes ABSORB, so this SHOULD trigger
155 EXPECT_TRUE(sSpellMgr->CanSpellTriggerProcOnEvent(procEntry, eventInfo));
156}
@ PROC_SPELL_PHASE_HIT
Definition SpellMgr.h:249
@ PROC_FLAG_DONE_PERIODIC
Definition SpellMgr.h:137
ProcEventInfoBuilder & WithSpellPhaseMask(uint32 spellPhaseMask)
Definition ProcEventInfoHelper.h:69
SpellProcEntryBuilder & WithSpellPhaseMask(uint32 spellPhaseMask)
Definition ProcEventInfoHelper.h:178

References ProcEventInfoBuilder::Build(), SpellProcEntryBuilder::Build(), PROC_FLAG_DONE_PERIODIC, PROC_HIT_ABSORB, PROC_SPELL_PHASE_HIT, sSpellMgr, ProcEventInfoBuilder::WithHitMask(), SpellProcEntryBuilder::WithHitMask(), SpellProcEntryBuilder::WithProcFlags(), ProcEventInfoBuilder::WithSpellPhaseMask(), SpellProcEntryBuilder::WithSpellPhaseMask(), and ProcEventInfoBuilder::WithTypeMask().

◆ TEST_F() [4/5]

TEST_F ( PeriodicAbsorbStealthProcTest  ,
NonAbsorbedPeriodicTriggersTakenProc   
)
88{
89 auto procEntry = SpellProcEntryBuilder()
91 .WithHitMask(0)
92 .Build();
93
94 // Normal periodic tick: hitMask includes PROC_HIT_NORMAL
95 auto eventInfo = ProcEventInfoBuilder()
98 .Build();
99
100 EXPECT_TRUE(sSpellMgr->CanSpellTriggerProcOnEvent(procEntry, eventInfo));
101}
@ PROC_HIT_NORMAL
Definition SpellMgr.h:257

References ProcEventInfoBuilder::Build(), SpellProcEntryBuilder::Build(), PROC_FLAG_TAKEN_PERIODIC, PROC_HIT_NORMAL, sSpellMgr, ProcEventInfoBuilder::WithHitMask(), SpellProcEntryBuilder::WithHitMask(), SpellProcEntryBuilder::WithProcFlags(), and ProcEventInfoBuilder::WithTypeMask().

◆ TEST_F() [5/5]

TEST_F ( PeriodicAbsorbStealthProcTest  ,
PartiallyAbsorbedPeriodicTriggersTakenProc   
)