AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
BinarySpellDetectionTest.cpp File Reference
#include "SpellInfoTestHelper.h"
#include "SpellInfo.h"
#include "SharedDefines.h"
#include "gtest/gtest.h"

Go to the source code of this file.

Classes

class  BinarySpellDetectionTest
 

Functions

 TEST_F (BinarySpellDetectionTest, AuraWithCalcValue_IsBinary)
 
 TEST_F (BinarySpellDetectionTest, AuraWithZeroCalcValue_NotBinary)
 
 TEST_F (BinarySpellDetectionTest, InterruptCast_IsBinary)
 
 TEST_F (BinarySpellDetectionTest, InterruptCastWithNoImmunities_NotBinary)
 
 TEST_F (BinarySpellDetectionTest, FearLikeSpell_SecondEffectHasValue_IsBinary)
 
 TEST_F (BinarySpellDetectionTest, PolymorphLikeSpell_IsBinary)
 
 TEST_F (BinarySpellDetectionTest, FrostNovaLikeSpell_IsBinary)
 

Function Documentation

◆ TEST_F() [1/7]

TEST_F ( BinarySpellDetectionTest  ,
AuraWithCalcValue_IsBinary   
)
58{
59 auto spell = SpellInfoBuilder()
62 .WithEffectDieSides(0, 1) // CalcValue = 0 + 1 = 1
64 .BuildUnique();
65
66 EXPECT_TRUE(ShouldMarkBinary(spell.get(), 0));
67}
@ SPELL_EFFECT_APPLY_AURA
Definition SharedDefines.h:772
@ SPELL_SCHOOL_MASK_SHADOW
Definition SharedDefines.h:290
@ SPELL_AURA_MOD_FEAR
Definition SpellAuraDefines.h:70
Builder class for creating SpellInfo test instances.
Definition SpellInfoTestHelper.h:160
SpellInfoBuilder & WithEffectBasePoints(uint8 effIndex, int32 basePoints)
Definition SpellInfoTestHelper.h:230
std::unique_ptr< SpellInfo > BuildUnique()
Definition SpellInfoTestHelper.h:256
SpellInfoBuilder & WithSchoolMask(uint32 schoolMask)
Definition SpellInfoTestHelper.h:182
SpellInfoBuilder & WithEffectDieSides(uint8 effIndex, int32 dieSides)
Definition SpellInfoTestHelper.h:236
SpellInfoBuilder & WithEffect(uint8 effIndex, uint32 effect, uint32 auraType=0)
Definition SpellInfoTestHelper.h:218

References SpellInfoBuilder::BuildUnique(), SPELL_AURA_MOD_FEAR, SPELL_EFFECT_APPLY_AURA, SPELL_SCHOOL_MASK_SHADOW, SpellInfoBuilder::WithEffect(), SpellInfoBuilder::WithEffectBasePoints(), SpellInfoBuilder::WithEffectDieSides(), and SpellInfoBuilder::WithSchoolMask().

◆ TEST_F() [2/7]

◆ TEST_F() [3/7]

TEST_F ( BinarySpellDetectionTest  ,
FearLikeSpell_SecondEffectHasValue_IsBinary   
)
112{
113 auto spell = SpellInfoBuilder()
116 .WithEffectDieSides(0, 1) // CalcValue = -1 + 1 = 0
119 .WithEffectDieSides(1, 1) // CalcValue = 24 + 1 = 25
121 .BuildUnique();
122
123 // Effect 0 has CalcValue 0, should not mark binary
124 EXPECT_FALSE(ShouldMarkBinary(spell.get(), 0));
125 // Effect 1 has CalcValue 25, should mark binary
126 EXPECT_TRUE(ShouldMarkBinary(spell.get(), 1));
127}
@ SPELL_AURA_MOD_INCREASE_SPEED
Definition SpellAuraDefines.h:94

References SpellInfoBuilder::BuildUnique(), SPELL_AURA_MOD_FEAR, SPELL_AURA_MOD_INCREASE_SPEED, SPELL_EFFECT_APPLY_AURA, SPELL_SCHOOL_MASK_SHADOW, SpellInfoBuilder::WithEffect(), SpellInfoBuilder::WithEffectBasePoints(), SpellInfoBuilder::WithEffectDieSides(), and SpellInfoBuilder::WithSchoolMask().

◆ TEST_F() [4/7]

TEST_F ( BinarySpellDetectionTest  ,
FrostNovaLikeSpell_IsBinary   
)
144{
145 auto spell = SpellInfoBuilder()
148 .WithEffectDieSides(0, 1) // CalcValue = 1
150 .BuildUnique();
151
152 EXPECT_TRUE(ShouldMarkBinary(spell.get(), 0));
153}
@ SPELL_SCHOOL_MASK_FROST
Definition SharedDefines.h:289
@ SPELL_AURA_MOD_ROOT
Definition SpellAuraDefines.h:89

References SpellInfoBuilder::BuildUnique(), SPELL_AURA_MOD_ROOT, SPELL_EFFECT_APPLY_AURA, SPELL_SCHOOL_MASK_FROST, SpellInfoBuilder::WithEffect(), SpellInfoBuilder::WithEffectBasePoints(), SpellInfoBuilder::WithEffectDieSides(), and SpellInfoBuilder::WithSchoolMask().

◆ TEST_F() [5/7]

TEST_F ( BinarySpellDetectionTest  ,
InterruptCast_IsBinary   
)

◆ TEST_F() [6/7]

TEST_F ( BinarySpellDetectionTest  ,
InterruptCastWithNoImmunities_NotBinary   
)

◆ TEST_F() [7/7]

TEST_F ( BinarySpellDetectionTest  ,
PolymorphLikeSpell_IsBinary   
)
131{
132 auto spell = SpellInfoBuilder()
135 .WithEffectDieSides(0, 1) // CalcValue = 1
137 .BuildUnique();
138
139 EXPECT_TRUE(ShouldMarkBinary(spell.get(), 0));
140}
@ SPELL_SCHOOL_MASK_ARCANE
Definition SharedDefines.h:291
@ SPELL_AURA_MOD_CONFUSE
Definition SpellAuraDefines.h:68

References SpellInfoBuilder::BuildUnique(), SPELL_AURA_MOD_CONFUSE, SPELL_EFFECT_APPLY_AURA, SPELL_SCHOOL_MASK_ARCANE, SpellInfoBuilder::WithEffect(), SpellInfoBuilder::WithEffectBasePoints(), SpellInfoBuilder::WithEffectDieSides(), and SpellInfoBuilder::WithSchoolMask().