From f128049f99b97caf32716e5376e7ad67cb79a3b4 Mon Sep 17 00:00:00 2001 From: clydebarrow <2366188+clydebarrow@users.noreply.github.com> Date: Sun, 18 Oct 2026 19:10:22 +1100 Subject: [PATCH] [packet_interface] Fix clang-tidy findings in tests Co-Authored-By: Claude Opus 5.5 --- tests/components/udp/udp_packet_interface.cpp | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/components/udp/udp_packet_interface.cpp b/tests/components/udp/udp_packet_interface.cpp index 532eee848cc..6eccbfacd6d 100644 --- a/tests/components/udp/udp_packet_interface.cpp +++ b/tests/components/udp/udp_packet_interface.cpp @@ -37,35 +37,35 @@ class TestUdp : public UdpPacketInterface { // The udp component is not set up, so it has no destinations and a send does nothing class UdpPacketInterfaceTest : public ::testing::Test { protected: - UDPComponent udp; - TestUdp link{&udp}; + UDPComponent udp_; + TestUdp link_{&this->udp_}; }; TEST_F(UdpPacketInterfaceTest, ReceivedPacketsUpToMaxPassedUp) { Packet packet{1, 2, 3, 4, 5, 6, 7, 8}; - this->link.receive_(packet); + this->link_.receive_(packet); Packet oversized{1, 2, 3, 4, 5, 6, 7, 8, 9}; - this->link.receive_(oversized); - EXPECT_EQ(this->link.received, std::vector{packet}); + this->link_.receive_(oversized); + EXPECT_EQ(this->link_.received, std::vector{packet}); } TEST_F(UdpPacketInterfaceTest, SendsContiguousAndSplitPackets) { - this->link.setup(); + this->link_.setup(); Packet packet{1, 2, 3, 4}; - EXPECT_TRUE(this->link.send_to_interface(PacketBuffer(packet), {})); + EXPECT_TRUE(this->link_.send_to_interface(PacketBuffer(packet), {})); uint8_t header = 0; PacketBuffer body(packet); - EXPECT_TRUE(this->link.send_to_interface(PacketBuffer(&header, 1, &body, nullptr, 0), {})); + EXPECT_TRUE(this->link_.send_to_interface(PacketBuffer(&header, 1, &body, nullptr, 0), {})); } TEST_F(UdpPacketInterfaceTest, OversizedPacketNotSent) { - this->link.setup(); + this->link_.setup(); Packet packet{1, 2, 3, 4, 5, 6, 7, 8, 9}; - EXPECT_FALSE(this->link.send_to_interface(PacketBuffer(packet), {})); + EXPECT_FALSE(this->link_.send_to_interface(PacketBuffer(packet), {})); uint8_t header = 0; Packet body_data{1, 2, 3, 4, 5, 6, 7, 8}; PacketBuffer body(body_data); - EXPECT_FALSE(this->link.send_to_interface(PacketBuffer(&header, 1, &body, nullptr, 0), {})); + EXPECT_FALSE(this->link_.send_to_interface(PacketBuffer(&header, 1, &body, nullptr, 0), {})); } } // namespace esphome::udp::testing