From c91f05d0a4eb280ed7167590055df1c99eb671fb Mon Sep 17 00:00:00 2001 From: clydebarrow <2366188+clydebarrow@users.noreply.github.com> Date: Sun, 18 Oct 2026 20:15:31 +1100 Subject: [PATCH] [packet_interface] Keep App alive across tests Co-Authored-By: Claude Opus 5.5 --- tests/components/entity_transport/entity_transport.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/components/entity_transport/entity_transport.cpp b/tests/components/entity_transport/entity_transport.cpp index 222e1744cf8..3b65827571f 100644 --- a/tests/components/entity_transport/entity_transport.cpp +++ b/tests/components/entity_transport/entity_transport.cpp @@ -68,12 +68,16 @@ static Packet header(uint8_t packet_type, uint32_t id) { class EntityTransportTest : public ::testing::Test { protected: void SetUp() override { - new (&App) Application; + App.~Application(); + new (&App) Application(); static char name[] = "this-device"; static char friendly_name[] = ""; App.pre_setup(name, sizeof(name) - 1, friendly_name, 0); } - void TearDown() override { App.~Application(); } + void TearDown() override { + App.~Application(); + new (&App) Application(); // later tests and the test listener use App + } // The sender, with a sensor and a binary sensor std::unique_ptr make_sender_() {