From 1c82d972ae17f79a4620783f8f57ab7793e5da72 Mon Sep 17 00:00:00 2001 From: DawnFire42 Date: Mon, 10 Aug 2026 16:33:53 -0400 Subject: [PATCH] Add test for missing tax counter to pin evaluateModifyCounter check ordering + test comment cleanup --- .../counter_command_auth_test.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/command_zone_tests/counter_command_auth_test.cpp b/tests/command_zone_tests/counter_command_auth_test.cpp index e7905428d..2b76509dd 100644 --- a/tests/command_zone_tests/counter_command_auth_test.cpp +++ b/tests/command_zone_tests/counter_command_auth_test.cpp @@ -24,8 +24,6 @@ Server_Counter makeCounter(int id, int count) } } // namespace -// evaluateDelCounter - TEST(EvaluateDelCounter, RejectsWhenGameNotStarted) { Server_Counter counter = makeCounter(UserCounterId, 0); @@ -70,8 +68,6 @@ TEST(EvaluateDelCounter, GameNotStartedTakesPrecedenceOverTaxGuard) Response::RespGameNotStarted); } -// evaluateSetCounterActive - TEST(EvaluateSetCounterActive, RejectsWhenGameNotStarted) { Server_Counter counter = makeCounter(CounterIds::CommanderTax, 0); @@ -150,8 +146,6 @@ TEST(EvaluateSetCounterActive, RejectsDisablingPartnerTaxWhenAccumulated) Response::RespContextError); } -// evaluateCreateCounter - TEST(EvaluateCreateCounter, RejectsWhenGameNotStarted) { EXPECT_EQ(Server_Player::evaluateCreateCounter(/*gameStarted=*/false, /*playerConceded=*/false, "mycounter"), @@ -183,8 +177,6 @@ TEST(EvaluateCreateCounter, AllowsOrdinaryNames) EXPECT_EQ(Server_Player::evaluateCreateCounter(true, false, ""), Response::RespOk); } -// evaluateModifyCounter (shared by cmdIncCounter / cmdSetCounter) - TEST(EvaluateModifyCounter, RejectsWhenGameNotStarted) { Server_Counter counter = makeCounter(UserCounterId, 0); @@ -238,6 +230,13 @@ TEST(EvaluateModifyCounter, AllowsActiveTaxCounter) Response::RespOk); } +TEST(EvaluateModifyCounter, RejectsMissingTaxCounter) +{ + EXPECT_EQ(Server_Player::evaluateModifyCounter(true, false, /*commandZoneEnabled=*/true, CounterIds::CommanderTax, + /*counter=*/nullptr), + Response::RespNameNotFound); +} + int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv);