AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
SpellProcDataDrivenTest.cpp File Reference

Comprehensive data-driven tests for ALL 869 spell_proc entries. More...

#include "ProcEventInfoHelper.h"
#include "SpellInfoTestHelper.h"
#include "SpellMgr.h"
#include "SpellProcTestData.h"
#include "WorldMock.h"
#include "gtest/gtest.h"
#include "gmock/gmock.h"
#include <map>
#include <set>

Go to the source code of this file.

Classes

struct  ProcFlagScenario
 
class  SpellProcDatabaseTest
 

Functions

 TEST_F (SpellProcDatabaseTest, AllEntriesLoaded)
 
 TEST_F (SpellProcDatabaseTest, AllEntriesWithProcFlags_PositiveTest)
 
 TEST_F (SpellProcDatabaseTest, AllEntriesWithProcFlags_NegativeTest)
 
 TEST_F (SpellProcDatabaseTest, MeleeProcs_AllTriggerOnMelee)
 
 TEST_F (SpellProcDatabaseTest, SpellDamageProcs_AllTriggerOnSpellDamage)
 
 TEST_F (SpellProcDatabaseTest, HealProcs_AllTriggerOnHeal)
 
 TEST_F (SpellProcDatabaseTest, PeriodicProcs_AllTriggerOnPeriodic)
 
 TEST_F (SpellProcDatabaseTest, KillProcs_AllTriggerOnKill)
 
 TEST_F (SpellProcDatabaseTest, CritOnlyProcs_OnlyTriggerOnCrit)
 
 TEST_F (SpellProcDatabaseTest, DodgeProcs_OnlyTriggerOnDodge)
 
 TEST_F (SpellProcDatabaseTest, ParryProcs_OnlyTriggerOnParry)
 
 TEST_F (SpellProcDatabaseTest, BlockProcs_OnlyTriggerOnBlock)
 
 TEST_F (SpellProcDatabaseTest, GroupBySpellFamily_Statistics)
 
 TEST_F (SpellProcDatabaseTest, GroupByProcFlags_Statistics)
 
 TEST_F (SpellProcDatabaseTest, GroupByHitMask_Statistics)
 
 TEST_F (SpellProcDatabaseTest, ToSpellProcEntry_ConversionCorrect)
 

Variables

static const std::vector< ProcFlagScenarioPROC_FLAG_SCENARIOS
 
static const std::vector< std::pair< uint32, const char * > > HIT_MASK_SCENARIOS
 

Detailed Description

Comprehensive data-driven tests for ALL 869 spell_proc entries.

This file auto-tests every spell_proc entry from the database. Data is generated by: src/test/scripts/generate_spell_proc_data.py

Definition in file SpellProcDataDrivenTest.cpp.

Function Documentation

◆ TEST_F() [1/16]

TEST_F ( SpellProcDatabaseTest  ,
AllEntriesLoaded   
)
259{
260 EXPECT_EQ(_allEntries.size(), 869u) << "Should have all 869 spell_proc entries loaded";
261}

◆ TEST_F() [2/16]

TEST_F ( SpellProcDatabaseTest  ,
AllEntriesWithProcFlags_NegativeTest   
)
319{
320 int totalTested = 0;
321 int correctlyRejected = 0;
322
323 for (auto const& entry : _allEntries)
324 {
325 if (entry.ProcFlags == 0)
326 continue;
327 if (RequiresSpellFamilyMatch(entry))
328 continue;
329
330 // Find a flag that's NOT in this entry's ProcFlags
331 uint32 wrongFlag = 0;
332 for (auto const& scenario : PROC_FLAG_SCENARIOS)
333 {
334 if (!(entry.ProcFlags & scenario.procFlag) && scenario.procFlag != PROC_FLAG_KILL)
335 {
336 wrongFlag = scenario.procFlag;
337 break;
338 }
339 }
340
341 if (wrongFlag == 0)
342 continue;
343
344 totalTested++;
345
346 SpellProcEntry procEntry = entry.ToSpellProcEntry();
347
348 auto eventInfo = ProcEventInfoBuilder()
349 .WithTypeMask(wrongFlag)
351 .Build();
352
353 if (!sSpellMgr->CanSpellTriggerProcOnEvent(procEntry, eventInfo))
354 {
355 correctlyRejected++;
356 }
357 }
358
359 float rejectRate = totalTested > 0 ? (float)correctlyRejected / totalTested * 100 : 0;
360 SCOPED_TRACE("Tested: " + std::to_string(totalTested));
361 SCOPED_TRACE("Rejected: " + std::to_string(correctlyRejected) + " (" + std::to_string((int)rejectRate) + "%)");
362
363 EXPECT_GT(rejectRate, 90.0f) << "Most entries should reject non-matching proc flags";
364}
std::uint32_t uint32
Definition Define.h:107
@ PROC_HIT_NORMAL
Definition SpellMgr.h:257
#define sSpellMgr
Definition SpellMgr.h:836
@ PROC_FLAG_KILL
Definition SpellMgr.h:111
static const std::vector< ProcFlagScenario > PROC_FLAG_SCENARIOS
Definition SpellProcDataDrivenTest.cpp:52
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
Definition SpellMgr.h:286

References ProcEventInfoBuilder::Build(), PROC_FLAG_KILL, PROC_FLAG_SCENARIOS, PROC_HIT_NORMAL, sSpellMgr, ProcEventInfoBuilder::WithHitMask(), and ProcEventInfoBuilder::WithTypeMask().

◆ TEST_F() [3/16]

TEST_F ( SpellProcDatabaseTest  ,
AllEntriesWithProcFlags_PositiveTest   
)
264{
265 int totalTested = 0;
266 int passed = 0;
267 int skippedFamily = 0;
268 int skippedNoFlags = 0;
269
270 for (auto const& entry : _allEntries)
271 {
272 // Skip entries with no ProcFlags (they rely on other conditions)
273 if (entry.ProcFlags == 0)
274 {
275 skippedNoFlags++;
276 continue;
277 }
278
279 // Skip entries that require SpellFamily matching
280 if (RequiresSpellFamilyMatch(entry))
281 {
282 skippedFamily++;
283 continue;
284 }
285
286 totalTested++;
287
288 ProcFlagScenario const* scenario = FindMatchingScenario(entry.ProcFlags);
289 if (!scenario)
290 continue;
291
292 SpellProcEntry procEntry = entry.ToSpellProcEntry();
293
294 auto eventInfo = CreateEventInfo(
295 scenario->procFlag,
296 GetEffectiveHitMask(entry, scenario),
297 GetEffectiveSpellTypeMask(entry, scenario),
298 GetEffectiveSpellPhaseMask(entry, scenario));
299
300 if (sSpellMgr->CanSpellTriggerProcOnEvent(procEntry, eventInfo))
301 {
302 passed++;
303 }
304 }
305
306 // Report statistics
307 float passRate = totalTested > 0 ? (float)passed / totalTested * 100 : 0;
308 SCOPED_TRACE("Total entries: " + std::to_string(_allEntries.size()));
309 SCOPED_TRACE("Tested: " + std::to_string(totalTested));
310 SCOPED_TRACE("Passed: " + std::to_string(passed) + " (" + std::to_string((int)passRate) + "%)");
311 SCOPED_TRACE("Skipped (SpellFamily): " + std::to_string(skippedFamily));
312 SCOPED_TRACE("Skipped (NoFlags): " + std::to_string(skippedNoFlags));
313
314 // Expect high pass rate for entries we can test
315 EXPECT_GT(passed, totalTested / 2) << "At least half of tested entries should pass";
316}
Definition SpellProcDataDrivenTest.cpp:43
uint32 procFlag
Definition SpellProcDataDrivenTest.cpp:44

References ProcFlagScenario::procFlag, and sSpellMgr.

◆ TEST_F() [4/16]

TEST_F ( SpellProcDatabaseTest  ,
BlockProcs_OnlyTriggerOnBlock   
)
650{
651 int tested = 0, passed = 0;
652
653 for (auto const& entry : _allEntries)
654 {
655 if (!(entry.HitMask & PROC_HIT_BLOCK))
656 continue;
657 if (entry.ProcFlags == 0)
658 continue;
659
660 ProcFlagScenario const* scenario = FindMatchingScenario(entry.ProcFlags);
661 if (!scenario)
662 continue;
663
664 tested++;
665 SpellProcEntry procEntry = entry.ToSpellProcEntry();
666
667 auto eventInfo = CreateEventInfo(
668 scenario->procFlag,
670 GetEffectiveSpellTypeMask(entry, scenario),
671 GetEffectiveSpellPhaseMask(entry, scenario));
672
673 if (sSpellMgr->CanSpellTriggerProcOnEvent(procEntry, eventInfo))
674 passed++;
675 }
676
677 SCOPED_TRACE("Block procs: " + std::to_string(tested) + " tested, " + std::to_string(passed) + " passed");
678 if (tested > 0)
679 EXPECT_EQ(passed, tested);
680}
@ PROC_HIT_BLOCK
Definition SpellMgr.h:263

References PROC_HIT_BLOCK, ProcFlagScenario::procFlag, and sSpellMgr.

◆ TEST_F() [5/16]

TEST_F ( SpellProcDatabaseTest  ,
CritOnlyProcs_OnlyTriggerOnCrit   
)
530{
531 int tested = 0, critPassed = 0, normalRejected = 0;
532
533 for (auto const& entry : _allEntries)
534 {
535 // Only entries with EXACTLY crit requirement
536 if (entry.HitMask != PROC_HIT_CRITICAL)
537 continue;
538 if (entry.ProcFlags == 0)
539 continue;
540 if (RequiresSpellFamilyMatch(entry))
541 continue;
542
543 ProcFlagScenario const* scenario = FindMatchingScenario(entry.ProcFlags);
544 if (!scenario)
545 continue;
546
547 tested++;
548 SpellProcEntry procEntry = entry.ToSpellProcEntry();
549
550 // Test crit - should pass
551 auto critEvent = CreateEventInfo(
552 scenario->procFlag,
554 GetEffectiveSpellTypeMask(entry, scenario),
555 GetEffectiveSpellPhaseMask(entry, scenario));
556
557 if (sSpellMgr->CanSpellTriggerProcOnEvent(procEntry, critEvent))
558 critPassed++;
559
560 // Test normal - should fail
561 auto normalEvent = CreateEventInfo(
562 scenario->procFlag,
564 GetEffectiveSpellTypeMask(entry, scenario),
565 GetEffectiveSpellPhaseMask(entry, scenario));
566
567 if (!sSpellMgr->CanSpellTriggerProcOnEvent(procEntry, normalEvent))
568 normalRejected++;
569 }
570
571 SCOPED_TRACE("Crit-only procs: " + std::to_string(tested) + " tested");
572 SCOPED_TRACE("Crit passed: " + std::to_string(critPassed));
573 SCOPED_TRACE("Normal rejected: " + std::to_string(normalRejected));
574
575 if (tested > 0)
576 {
577 // Most crit-only entries should work, but some may have additional requirements
578 EXPECT_GT(critPassed, 0) << "At least some crit-only procs should trigger on crits";
579 EXPECT_GT(normalRejected, 0) << "At least some crit-only procs should NOT trigger on normal hits";
580 }
581}
@ PROC_HIT_CRITICAL
Definition SpellMgr.h:258

References PROC_HIT_CRITICAL, PROC_HIT_NORMAL, ProcFlagScenario::procFlag, and sSpellMgr.

◆ TEST_F() [6/16]

TEST_F ( SpellProcDatabaseTest  ,
DodgeProcs_OnlyTriggerOnDodge   
)
584{
585 int tested = 0, passed = 0;
586
587 for (auto const& entry : _allEntries)
588 {
589 if (!(entry.HitMask & PROC_HIT_DODGE))
590 continue;
591 if (entry.ProcFlags == 0)
592 continue;
593
594 ProcFlagScenario const* scenario = FindMatchingScenario(entry.ProcFlags);
595 if (!scenario)
596 continue;
597
598 tested++;
599 SpellProcEntry procEntry = entry.ToSpellProcEntry();
600
601 auto eventInfo = CreateEventInfo(
602 scenario->procFlag,
604 GetEffectiveSpellTypeMask(entry, scenario),
605 GetEffectiveSpellPhaseMask(entry, scenario));
606
607 if (sSpellMgr->CanSpellTriggerProcOnEvent(procEntry, eventInfo))
608 passed++;
609 }
610
611 SCOPED_TRACE("Dodge procs: " + std::to_string(tested) + " tested, " + std::to_string(passed) + " passed");
612 if (tested > 0)
613 EXPECT_EQ(passed, tested);
614}
@ PROC_HIT_DODGE
Definition SpellMgr.h:261

References PROC_HIT_DODGE, ProcFlagScenario::procFlag, and sSpellMgr.

◆ TEST_F() [7/16]

TEST_F ( SpellProcDatabaseTest  ,
GroupByHitMask_Statistics   
)
722{
723 std::map<uint32, int> hitCounts;
724 for (auto const& entry : _allEntries)
725 {
726 hitCounts[entry.HitMask]++;
727 }
728
729 SCOPED_TRACE("Unique HitMask patterns: " + std::to_string(hitCounts.size()));
730 EXPECT_GT(hitCounts.size(), 0u);
731}

◆ TEST_F() [8/16]

TEST_F ( SpellProcDatabaseTest  ,
GroupByProcFlags_Statistics   
)
710{
711 std::map<uint32, int> flagCounts;
712 for (auto const& entry : _allEntries)
713 {
714 flagCounts[entry.ProcFlags]++;
715 }
716
717 SCOPED_TRACE("Unique ProcFlags patterns: " + std::to_string(flagCounts.size()));
718 EXPECT_GT(flagCounts.size(), 0u);
719}

◆ TEST_F() [9/16]

TEST_F ( SpellProcDatabaseTest  ,
GroupBySpellFamily_Statistics   
)
687{
688 std::map<uint32, std::string> familyNames = {
689 {0, "Generic"}, {3, "Mage"}, {4, "Warrior"}, {5, "Warlock"},
690 {6, "Priest"}, {7, "Druid"}, {8, "Rogue"}, {9, "Hunter"},
691 {10, "Paladin"}, {11, "Shaman"}, {15, "DeathKnight"}
692 };
693
694 std::map<uint32, int> familyCounts;
695 for (auto const& entry : _allEntries)
696 {
697 familyCounts[entry.SpellFamilyName]++;
698 }
699
700 for (auto const& [family, count] : familyCounts)
701 {
702 std::string name = familyNames.count(family) ? familyNames[family] : "Unknown(" + std::to_string(family) + ")";
703 SCOPED_TRACE("SpellFamily " + name + ": " + std::to_string(count) + " entries");
704 }
705
706 EXPECT_GT(familyCounts.size(), 0u);
707}

◆ TEST_F() [10/16]

TEST_F ( SpellProcDatabaseTest  ,
HealProcs_AllTriggerOnHeal   
)
434{
435 int tested = 0, passed = 0;
436
437 for (auto const& entry : _allEntries)
438 {
439 if (!(entry.ProcFlags & PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS))
440 continue;
441 if (RequiresSpellFamilyMatch(entry))
442 continue;
443
444 tested++;
445 SpellProcEntry procEntry = entry.ToSpellProcEntry();
446
447 uint32 hitMask = entry.HitMask != 0 ? (entry.HitMask & -entry.HitMask) : PROC_HIT_NORMAL;
448 uint32 spellTypeMask = entry.SpellTypeMask != 0 ? entry.SpellTypeMask : PROC_SPELL_TYPE_HEAL;
449 uint32 spellPhaseMask = entry.SpellPhaseMask != 0 ? entry.SpellPhaseMask : PROC_SPELL_PHASE_HIT;
450
451 auto eventInfo = CreateEventInfo(
453 hitMask,
455 spellPhaseMask);
456
457 if (sSpellMgr->CanSpellTriggerProcOnEvent(procEntry, eventInfo))
458 passed++;
459 }
460
461 SCOPED_TRACE("Heal procs: " + std::to_string(tested) + " tested, " + std::to_string(passed) + " passed");
462 if (tested > 0)
463 EXPECT_GT(passed, 0);
464}
static uint32 spellTypeMask[TOTAL_AURAS]
Definition SpellMgr.cpp:1819
@ PROC_SPELL_TYPE_HEAL
Definition SpellMgr.h:240
@ PROC_SPELL_PHASE_HIT
Definition SpellMgr.h:249
@ PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS
Definition SpellMgr.h:131
uint32 HitMask
Definition SpellMgr.h:293

References SpellProcEntry::HitMask, PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS, PROC_HIT_NORMAL, PROC_SPELL_PHASE_HIT, PROC_SPELL_TYPE_HEAL, spellTypeMask, and sSpellMgr.

◆ TEST_F() [11/16]

TEST_F ( SpellProcDatabaseTest  ,
KillProcs_AllTriggerOnKill   
)
500{
501 int tested = 0, passed = 0;
502
503 for (auto const& entry : _allEntries)
504 {
505 if (!(entry.ProcFlags & PROC_FLAG_KILL))
506 continue;
507
508 tested++;
509 SpellProcEntry procEntry = entry.ToSpellProcEntry();
510
511 auto eventInfo = ProcEventInfoBuilder()
514 .Build();
515
516 if (sSpellMgr->CanSpellTriggerProcOnEvent(procEntry, eventInfo))
517 passed++;
518 }
519
520 SCOPED_TRACE("Kill procs: " + std::to_string(tested) + " tested, " + std::to_string(passed) + " passed");
521 // Kill events always proc
522 EXPECT_EQ(passed, tested);
523}

References ProcEventInfoBuilder::Build(), PROC_FLAG_KILL, PROC_HIT_NORMAL, sSpellMgr, ProcEventInfoBuilder::WithHitMask(), and ProcEventInfoBuilder::WithTypeMask().

◆ TEST_F() [12/16]

TEST_F ( SpellProcDatabaseTest  ,
MeleeProcs_AllTriggerOnMelee   
)
371{
372 int tested = 0, passed = 0;
373
374 for (auto const& entry : _allEntries)
375 {
376 if (!(entry.ProcFlags & PROC_FLAG_DONE_MELEE_AUTO_ATTACK))
377 continue;
378 if (RequiresSpellFamilyMatch(entry))
379 continue;
380
381 tested++;
382 SpellProcEntry procEntry = entry.ToSpellProcEntry();
383
384 uint32 hitMask = entry.HitMask != 0 ? (entry.HitMask & -entry.HitMask) : PROC_HIT_NORMAL;
385
386 auto eventInfo = ProcEventInfoBuilder()
388 .WithHitMask(hitMask)
389 .Build();
390
391 if (sSpellMgr->CanSpellTriggerProcOnEvent(procEntry, eventInfo))
392 passed++;
393 }
394
395 SCOPED_TRACE("Melee procs: " + std::to_string(tested) + " tested, " + std::to_string(passed) + " passed");
396 if (tested > 0)
397 EXPECT_EQ(passed, tested);
398}
@ PROC_FLAG_DONE_MELEE_AUTO_ATTACK
Definition SpellMgr.h:113

References ProcEventInfoBuilder::Build(), SpellProcEntry::HitMask, PROC_FLAG_DONE_MELEE_AUTO_ATTACK, PROC_HIT_NORMAL, sSpellMgr, ProcEventInfoBuilder::WithHitMask(), and ProcEventInfoBuilder::WithTypeMask().

◆ TEST_F() [13/16]

TEST_F ( SpellProcDatabaseTest  ,
ParryProcs_OnlyTriggerOnParry   
)
617{
618 int tested = 0, passed = 0;
619
620 for (auto const& entry : _allEntries)
621 {
622 if (!(entry.HitMask & PROC_HIT_PARRY))
623 continue;
624 if (entry.ProcFlags == 0)
625 continue;
626
627 ProcFlagScenario const* scenario = FindMatchingScenario(entry.ProcFlags);
628 if (!scenario)
629 continue;
630
631 tested++;
632 SpellProcEntry procEntry = entry.ToSpellProcEntry();
633
634 auto eventInfo = CreateEventInfo(
635 scenario->procFlag,
637 GetEffectiveSpellTypeMask(entry, scenario),
638 GetEffectiveSpellPhaseMask(entry, scenario));
639
640 if (sSpellMgr->CanSpellTriggerProcOnEvent(procEntry, eventInfo))
641 passed++;
642 }
643
644 SCOPED_TRACE("Parry procs: " + std::to_string(tested) + " tested, " + std::to_string(passed) + " passed");
645 if (tested > 0)
646 EXPECT_EQ(passed, tested);
647}
@ PROC_HIT_PARRY
Definition SpellMgr.h:262

References PROC_HIT_PARRY, ProcFlagScenario::procFlag, and sSpellMgr.

◆ TEST_F() [14/16]

TEST_F ( SpellProcDatabaseTest  ,
PeriodicProcs_AllTriggerOnPeriodic   
)
467{
468 int tested = 0, passed = 0;
469
470 for (auto const& entry : _allEntries)
471 {
472 if (!(entry.ProcFlags & PROC_FLAG_DONE_PERIODIC))
473 continue;
474 if (RequiresSpellFamilyMatch(entry))
475 continue;
476
477 tested++;
478 SpellProcEntry procEntry = entry.ToSpellProcEntry();
479
480 uint32 hitMask = entry.HitMask != 0 ? (entry.HitMask & -entry.HitMask) : PROC_HIT_NORMAL;
481 uint32 spellTypeMask = entry.SpellTypeMask != 0 ? entry.SpellTypeMask : PROC_SPELL_TYPE_DAMAGE;
482 uint32 spellPhaseMask = entry.SpellPhaseMask != 0 ? entry.SpellPhaseMask : PROC_SPELL_PHASE_HIT;
483
484 auto eventInfo = CreateEventInfo(
486 hitMask,
488 spellPhaseMask);
489
490 if (sSpellMgr->CanSpellTriggerProcOnEvent(procEntry, eventInfo))
491 passed++;
492 }
493
494 SCOPED_TRACE("Periodic procs: " + std::to_string(tested) + " tested, " + std::to_string(passed) + " passed");
495 if (tested > 0)
496 EXPECT_GT(passed, 0);
497}
@ PROC_SPELL_TYPE_DAMAGE
Definition SpellMgr.h:239
@ PROC_FLAG_DONE_PERIODIC
Definition SpellMgr.h:137

References SpellProcEntry::HitMask, PROC_FLAG_DONE_PERIODIC, PROC_HIT_NORMAL, PROC_SPELL_PHASE_HIT, PROC_SPELL_TYPE_DAMAGE, spellTypeMask, and sSpellMgr.

◆ TEST_F() [15/16]

TEST_F ( SpellProcDatabaseTest  ,
SpellDamageProcs_AllTriggerOnSpellDamage   
)
401{
402 int tested = 0, passed = 0;
403
404 for (auto const& entry : _allEntries)
405 {
406 if (!(entry.ProcFlags & PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG))
407 continue;
408 if (RequiresSpellFamilyMatch(entry))
409 continue;
410
411 tested++;
412 SpellProcEntry procEntry = entry.ToSpellProcEntry();
413
414 uint32 hitMask = entry.HitMask != 0 ? (entry.HitMask & -entry.HitMask) : PROC_HIT_NORMAL;
415 uint32 spellTypeMask = entry.SpellTypeMask != 0 ? entry.SpellTypeMask : PROC_SPELL_TYPE_DAMAGE;
416 uint32 spellPhaseMask = entry.SpellPhaseMask != 0 ? entry.SpellPhaseMask : PROC_SPELL_PHASE_HIT;
417
418 auto eventInfo = CreateEventInfo(
420 hitMask,
422 spellPhaseMask);
423
424 if (sSpellMgr->CanSpellTriggerProcOnEvent(procEntry, eventInfo))
425 passed++;
426 }
427
428 SCOPED_TRACE("Spell damage procs: " + std::to_string(tested) + " tested, " + std::to_string(passed) + " passed");
429 if (tested > 0)
430 EXPECT_GT(passed, 0);
431}
@ PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG
Definition SpellMgr.h:134

References SpellProcEntry::HitMask, PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG, PROC_HIT_NORMAL, PROC_SPELL_PHASE_HIT, PROC_SPELL_TYPE_DAMAGE, spellTypeMask, and sSpellMgr.

◆ TEST_F() [16/16]

TEST_F ( SpellProcDatabaseTest  ,
ToSpellProcEntry_ConversionCorrect   
)
738{
739 for (auto const& entry : _allEntries)
740 {
741 SpellProcEntry converted = entry.ToSpellProcEntry();
742
743 EXPECT_EQ(converted.SchoolMask, entry.SchoolMask);
744 EXPECT_EQ(converted.SpellFamilyName, entry.SpellFamilyName);
745 EXPECT_EQ(converted.SpellFamilyMask[0], entry.SpellFamilyMask0);
746 EXPECT_EQ(converted.SpellFamilyMask[1], entry.SpellFamilyMask1);
747 EXPECT_EQ(converted.SpellFamilyMask[2], entry.SpellFamilyMask2);
748 EXPECT_EQ(converted.ProcFlags, entry.ProcFlags);
749 EXPECT_EQ(converted.SpellTypeMask, entry.SpellTypeMask);
750 EXPECT_EQ(converted.SpellPhaseMask, entry.SpellPhaseMask);
751 EXPECT_EQ(converted.HitMask, entry.HitMask);
752 EXPECT_EQ(converted.AttributesMask, entry.AttributesMask);
753 EXPECT_EQ(converted.Cooldown.count(), static_cast<int64>(entry.Cooldown));
754 EXPECT_FLOAT_EQ(converted.Chance, entry.Chance);
755 }
756}
std::int64_t int64
Definition Define.h:102
uint32 SpellFamilyName
Definition SpellMgr.h:288
Milliseconds Cooldown
Definition SpellMgr.h:298
uint32 AttributesMask
Definition SpellMgr.h:294
flag96 SpellFamilyMask
Definition SpellMgr.h:289
uint32 SpellTypeMask
Definition SpellMgr.h:291
uint32 ProcFlags
Definition SpellMgr.h:290
uint32 SpellPhaseMask
Definition SpellMgr.h:292
uint32 SchoolMask
Definition SpellMgr.h:287
float Chance
Definition SpellMgr.h:297

References SpellProcEntry::AttributesMask, SpellProcEntry::Chance, SpellProcEntry::Cooldown, SpellProcEntry::HitMask, SpellProcEntry::ProcFlags, SpellProcEntry::SchoolMask, SpellProcEntry::SpellFamilyMask, SpellProcEntry::SpellFamilyName, SpellProcEntry::SpellPhaseMask, and SpellProcEntry::SpellTypeMask.

Variable Documentation

◆ HIT_MASK_SCENARIOS

const std::vector<std::pair<uint32, const char*> > HIT_MASK_SCENARIOS
static
Initial value:
= {
{ PROC_HIT_NORMAL, "Normal" },
{ PROC_HIT_CRITICAL, "Critical" },
{ PROC_HIT_MISS, "Miss" },
{ PROC_HIT_DODGE, "Dodge" },
{ PROC_HIT_PARRY, "Parry" },
{ PROC_HIT_BLOCK, "Block" },
{ PROC_HIT_EVADE, "Evade" },
{ PROC_HIT_IMMUNE, "Immune" },
{ PROC_HIT_DEFLECT, "Deflect" },
{ PROC_HIT_ABSORB, "Absorb" },
{ PROC_HIT_REFLECT, "Reflect" },
{ PROC_HIT_INTERRUPT, "Interrupt" },
{ PROC_HIT_FULL_BLOCK, "FullBlock" },
}
@ PROC_HIT_FULL_BLOCK
Definition SpellMgr.h:270
@ PROC_HIT_MISS
Definition SpellMgr.h:259
@ PROC_HIT_INTERRUPT
Definition SpellMgr.h:269
@ PROC_HIT_DEFLECT
Definition SpellMgr.h:266
@ PROC_HIT_EVADE
Definition SpellMgr.h:264
@ PROC_HIT_IMMUNE
Definition SpellMgr.h:265
@ PROC_HIT_ABSORB
Definition SpellMgr.h:267
@ PROC_HIT_REFLECT
Definition SpellMgr.h:268
80 {
81 { PROC_HIT_NORMAL, "Normal" },
82 { PROC_HIT_CRITICAL, "Critical" },
83 { PROC_HIT_MISS, "Miss" },
84 { PROC_HIT_DODGE, "Dodge" },
85 { PROC_HIT_PARRY, "Parry" },
86 { PROC_HIT_BLOCK, "Block" },
87 { PROC_HIT_EVADE, "Evade" },
88 { PROC_HIT_IMMUNE, "Immune" },
89 { PROC_HIT_DEFLECT, "Deflect" },
90 { PROC_HIT_ABSORB, "Absorb" },
91 { PROC_HIT_REFLECT, "Reflect" },
92 { PROC_HIT_INTERRUPT, "Interrupt" },
93 { PROC_HIT_FULL_BLOCK, "FullBlock" },
94};

Referenced by SpellProcDatabaseTest::GetEffectiveHitMask().

◆ PROC_FLAG_SCENARIOS

const std::vector<ProcFlagScenario> PROC_FLAG_SCENARIOS
static
Initial value:
= {
{ PROC_FLAG_DONE_MELEE_AUTO_ATTACK, "DoneMeleeAuto", PROC_HIT_NORMAL, 0, 0, false },
{ PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK, "TakenMeleeAuto", PROC_HIT_NORMAL, 0, 0, false },
{ PROC_FLAG_DONE_MAINHAND_ATTACK, "DoneMainhand", PROC_HIT_NORMAL, 0, 0, false },
{ PROC_FLAG_DONE_OFFHAND_ATTACK, "DoneOffhand", PROC_HIT_NORMAL, 0, 0, false },
{ PROC_FLAG_TAKEN_DAMAGE, "TakenDamage", PROC_HIT_NORMAL, 0, 0, false },
{ PROC_FLAG_KILL, "Kill", 0, 0, 0, false },
{ PROC_FLAG_KILLED, "Killed", 0, 0, 0, false },
{ PROC_FLAG_DEATH, "Death", 0, 0, 0, false },
}
@ PROC_FLAG_DONE_SPELL_RANGED_DMG_CLASS
Definition SpellMgr.h:122
@ PROC_FLAG_TAKEN_RANGED_AUTO_ATTACK
Definition SpellMgr.h:120
@ PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS
Definition SpellMgr.h:125
@ PROC_FLAG_KILLED
Definition SpellMgr.h:110
@ PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS
Definition SpellMgr.h:116
@ PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG
Definition SpellMgr.h:135
@ PROC_FLAG_DEATH
Definition SpellMgr.h:146
@ PROC_FLAG_TAKEN_SPELL_RANGED_DMG_CLASS
Definition SpellMgr.h:123
@ PROC_FLAG_TAKEN_PERIODIC
Definition SpellMgr.h:138
@ PROC_FLAG_DONE_MAINHAND_ATTACK
Definition SpellMgr.h:143
@ PROC_FLAG_DONE_RANGED_AUTO_ATTACK
Definition SpellMgr.h:119
@ PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_NEG
Definition SpellMgr.h:129
@ PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG
Definition SpellMgr.h:128
@ PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS
Definition SpellMgr.h:132
@ PROC_FLAG_TAKEN_DAMAGE
Definition SpellMgr.h:140
@ PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK
Definition SpellMgr.h:114
@ PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_POS
Definition SpellMgr.h:126
@ PROC_FLAG_TAKEN_SPELL_MELEE_DMG_CLASS
Definition SpellMgr.h:117
@ PROC_FLAG_DONE_TRAP_ACTIVATION
Definition SpellMgr.h:141
@ PROC_FLAG_DONE_OFFHAND_ATTACK
Definition SpellMgr.h:144
52 {
53 { PROC_FLAG_DONE_MELEE_AUTO_ATTACK, "DoneMeleeAuto", PROC_HIT_NORMAL, 0, 0, false },
54 { PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK, "TakenMeleeAuto", PROC_HIT_NORMAL, 0, 0, false },
55 { PROC_FLAG_DONE_MAINHAND_ATTACK, "DoneMainhand", PROC_HIT_NORMAL, 0, 0, false },
56 { PROC_FLAG_DONE_OFFHAND_ATTACK, "DoneOffhand", PROC_HIT_NORMAL, 0, 0, false },
73 { PROC_FLAG_TAKEN_DAMAGE, "TakenDamage", PROC_HIT_NORMAL, 0, 0, false },
74 { PROC_FLAG_KILL, "Kill", 0, 0, 0, false },
75 { PROC_FLAG_KILLED, "Killed", 0, 0, 0, false },
76 { PROC_FLAG_DEATH, "Death", 0, 0, 0, false },
78};

Referenced by SpellProcDatabaseTest::FindMatchingScenario(), and TEST_F().