![]() |
AzerothCore 3.3.5a
OpenSource WoW Emulator
|
Data-driven tests for ALL 869 spell_proc entries. More...
#include "ProcChanceTestHelper.h"#include "ProcEventInfoHelper.h"#include "SpellProcTestData.h"#include "AuraStub.h"#include "gtest/gtest.h"Go to the source code of this file.
Classes | |
| class | SpellProcFullCoverageTest |
| class | SpellProcCoverageStatsTest |
Functions | |
| TEST_P (SpellProcFullCoverageTest, CooldownBlocking_WhenCooldownSet) | |
| TEST_P (SpellProcFullCoverageTest, Level60Reduction_WhenAttributeSet) | |
| TEST_P (SpellProcFullCoverageTest, AttributeMask_ValidFlags) | |
| TEST_P (SpellProcFullCoverageTest, UseStacksForCharges_Behavior) | |
| TEST_P (SpellProcFullCoverageTest, TriggeredCanProc_FlagSet) | |
| TEST_P (SpellProcFullCoverageTest, ReqManaCost_FlagSet) | |
| TEST_P (SpellProcFullCoverageTest, ChanceValue_InValidRange) | |
| TEST_P (SpellProcFullCoverageTest, ChanceCalculation_WithEntry) | |
| TEST_P (SpellProcFullCoverageTest, ProcFlags_NotEmpty) | |
| TEST_P (SpellProcFullCoverageTest, CooldownValue_Reasonable) | |
| TEST_P (SpellProcFullCoverageTest, SpellId_NonZero) | |
| INSTANTIATE_TEST_SUITE_P (AllSpellProcEntries, SpellProcFullCoverageTest, ::testing::ValuesIn(GetAllSpellProcTestEntries()), [](const ::testing::TestParamInfo< SpellProcTestEntry > &info) { int32_t id=info.param.SpellId;if(id< 0) return "NegId_"+std::to_string(-id);return "SpellId_"+std::to_string(id);}) | |
| TEST_F (SpellProcCoverageStatsTest, CountEntriesWithCooldown) | |
| TEST_F (SpellProcCoverageStatsTest, CountEntriesWithChance) | |
| TEST_F (SpellProcCoverageStatsTest, CountEntriesWithLevel60Reduction) | |
| TEST_F (SpellProcCoverageStatsTest, CountEntriesWithUseStacks) | |
| TEST_F (SpellProcCoverageStatsTest, CountEntriesWithTriggeredCanProc) | |
| TEST_F (SpellProcCoverageStatsTest, CountEntriesWithReqManaCost) | |
| TEST_F (SpellProcCoverageStatsTest, TotalEntryCount) | |
Data-driven tests for ALL 869 spell_proc entries.
Tests proc calculations for every spell_proc entry:
This complements SpellProcDataDrivenTest.cpp which tests CanSpellTriggerProcOnEvent().
This test file uses parameterized tests that run against ALL 869 spell_proc entries. Each test validates a specific feature (cooldowns, level reduction, attribute flags, etc.). Tests use GTEST_SKIP() for entries that don't have the feature being tested.
For example (current counts from test output):
This is INTENTIONAL. Running parameterized tests against all entries ensures:
The statistics tests at the bottom output the exact counts: "[ INFO ] Entries with cooldown: 85 / 869" "[ INFO ] Entries with REDUCE_PROC_60: 15 / 869" etc.
SKIPPED tests are expected and correct. Each skip message includes:
Definition in file SpellProcFullCoverageTest.cpp.
| INSTANTIATE_TEST_SUITE_P | ( | AllSpellProcEntries | , |
| SpellProcFullCoverageTest | , | ||
| ::testing::ValuesIn(GetAllSpellProcTestEntries()) | , | ||
| [] (const ::testing::TestParamInfo< SpellProcTestEntry > &info) { int32_t id=info.param.SpellId;if(id< 0) return "NegId_"+std::to_string(-id);return "SpellId_"+std::to_string(id);} | |||
| ) |
| TEST_F | ( | SpellProcCoverageStatsTest | , |
| CountEntriesWithChance | |||
| ) |
| TEST_F | ( | SpellProcCoverageStatsTest | , |
| CountEntriesWithCooldown | |||
| ) |
| TEST_F | ( | SpellProcCoverageStatsTest | , |
| CountEntriesWithLevel60Reduction | |||
| ) |
References PROC_ATTR_REDUCE_PROC_60.
| TEST_F | ( | SpellProcCoverageStatsTest | , |
| CountEntriesWithReqManaCost | |||
| ) |
References PROC_ATTR_REQ_MANA_COST.
| TEST_F | ( | SpellProcCoverageStatsTest | , |
| CountEntriesWithTriggeredCanProc | |||
| ) |
References PROC_ATTR_TRIGGERED_CAN_PROC.
| TEST_F | ( | SpellProcCoverageStatsTest | , |
| CountEntriesWithUseStacks | |||
| ) |
References PROC_ATTR_USE_STACKS_FOR_CHARGES.
| TEST_F | ( | SpellProcCoverageStatsTest | , |
| TotalEntryCount | |||
| ) |
| TEST_P | ( | SpellProcFullCoverageTest | , |
| AttributeMask_ValidFlags | |||
| ) |
References PROC_ATTR_CANT_PROC_FROM_ITEM_CAST, PROC_ATTR_REDUCE_PROC_60, PROC_ATTR_REQ_EXP_OR_HONOR, PROC_ATTR_REQ_MANA_COST, PROC_ATTR_REQ_SPELLMOD, PROC_ATTR_TRIGGERED_CAN_PROC, and PROC_ATTR_USE_STACKS_FOR_CHARGES.
| TEST_P | ( | SpellProcFullCoverageTest | , |
| ChanceCalculation_WithEntry | |||
| ) |
References PROC_ATTR_REDUCE_PROC_60, and ProcChanceTestHelper::SimulateCalcProcChance().
| TEST_P | ( | SpellProcFullCoverageTest | , |
| ChanceValue_InValidRange | |||
| ) |
| TEST_P | ( | SpellProcFullCoverageTest | , |
| CooldownBlocking_WhenCooldownSet | |||
| ) |
References ProcTestScenario::AdvanceTime(), SpellProcEntry::Chance, SpellProcEntry::Cooldown, ProcTestScenario::SimulateProc(), and ProcTestScenario::WithAura().
| TEST_P | ( | SpellProcFullCoverageTest | , |
| CooldownValue_Reasonable | |||
| ) |
| TEST_P | ( | SpellProcFullCoverageTest | , |
| Level60Reduction_WhenAttributeSet | |||
| ) |
References ProcChanceTestHelper::ApplyLevel60Reduction(), and PROC_ATTR_REDUCE_PROC_60.
| TEST_P | ( | SpellProcFullCoverageTest | , |
| ProcFlags_NotEmpty | |||
| ) |
| TEST_P | ( | SpellProcFullCoverageTest | , |
| ReqManaCost_FlagSet | |||
| ) |
References PROC_ATTR_REQ_MANA_COST.
| TEST_P | ( | SpellProcFullCoverageTest | , |
| SpellId_NonZero | |||
| ) |
| TEST_P | ( | SpellProcFullCoverageTest | , |
| TriggeredCanProc_FlagSet | |||
| ) |
References PROC_ATTR_TRIGGERED_CAN_PROC.
| TEST_P | ( | SpellProcFullCoverageTest | , |
| UseStacksForCharges_Behavior | |||
| ) |
References AuraStubBuilder::Build(), SpellProcEntry::Chance, PROC_ATTR_USE_STACKS_FOR_CHARGES, ProcChanceTestHelper::SimulateConsumeProcCharges(), AuraStubBuilder::WithId(), and AuraStubBuilder::WithStackAmount().