From e5058d9016b673e97106961df1cdb9a3a255b78f Mon Sep 17 00:00:00 2001 From: Ali Saeed Date: Wed, 28 Aug 2024 18:29:31 +0000 Subject: [PATCH] pw_bluetooth_proxy: De-shadow variable names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Silence clang warnings for shadowed var names in tests. Change-Id: Ie43115b06f199d54cbb3f5886c5591423bc6bcb4 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/232491 Commit-Queue: Ali Saeed Reviewed-by: David Rees Reviewed-by: Ben Lawson Lint: Lint 🤖 --- pw_bluetooth_proxy/proxy_host_test.cc | 40 +++++++++++++-------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/pw_bluetooth_proxy/proxy_host_test.cc b/pw_bluetooth_proxy/proxy_host_test.cc index 5cad536543..38d10b8648 100644 --- a/pw_bluetooth_proxy/proxy_host_test.cc +++ b/pw_bluetooth_proxy/proxy_host_test.cc @@ -589,14 +589,14 @@ TEST(ReserveLeAclCredits, ProxyCreditsReserveCreditsWithLEReadBufferSizeV1) { uint8_t sends_called = 0; pw::Function send_to_host_fn( - [&sends_called](H4PacketWithHci&& h4_packet) { + [&sends_called](H4PacketWithHci&& received_packet) { sends_called++; - emboss::LEReadBufferSizeV1CommandCompleteEventWriter view = + emboss::LEReadBufferSizeV1CommandCompleteEventWriter event_view = MakeEmboss( - h4_packet.GetHciSpan()); + received_packet.GetHciSpan()); // Should reserve 2 credits from original total of 10 (so 8 left for // host). - EXPECT_EQ(view.total_num_le_acl_data_packets().Read(), 8); + EXPECT_EQ(event_view.total_num_le_acl_data_packets().Read(), 8); }); pw::Function send_to_controller_fn( @@ -633,14 +633,14 @@ TEST(ReserveLeAclCredits, ProxyCreditsReserveCreditsWithLEReadBufferSizeV2) { uint8_t sends_called = 0; pw::Function send_to_host_fn( - [&sends_called](H4PacketWithHci&& h4_packet) { + [&sends_called](H4PacketWithHci&& received_packet) { sends_called++; - emboss::LEReadBufferSizeV2CommandCompleteEventWriter view = + emboss::LEReadBufferSizeV2CommandCompleteEventWriter event_view = MakeEmboss( - h4_packet.GetHciSpan()); + received_packet.GetHciSpan()); // Should reserve 2 credits from original total of 10 (so 8 left for // host). - EXPECT_EQ(view.total_num_le_acl_data_packets().Read(), 8); + EXPECT_EQ(event_view.total_num_le_acl_data_packets().Read(), 8); }); pw::Function send_to_controller_fn( @@ -677,14 +677,14 @@ TEST(ReserveLeAclCredits, ProxyCreditsCappedByControllerCredits) { uint8_t sends_called = 0; pw::Function send_to_host_fn( - [&sends_called](H4PacketWithHci&& h4_packet) { + [&sends_called](H4PacketWithHci&& received_packet) { sends_called++; // We want 7, but can reserve only 5 from original 5 (so 0 left for // host). - emboss::LEReadBufferSizeV1CommandCompleteEventWriter view = + emboss::LEReadBufferSizeV1CommandCompleteEventWriter event_view = MakeEmboss( - h4_packet.GetHciSpan()); - EXPECT_EQ(view.total_num_le_acl_data_packets().Read(), 0); + received_packet.GetHciSpan()); + EXPECT_EQ(event_view.total_num_le_acl_data_packets().Read(), 0); }); pw::Function send_to_controller_fn( @@ -718,14 +718,14 @@ TEST(ReserveLeAclCredits, ProxyCreditsReserveZeroCredits) { uint8_t sends_called = 0; pw::Function send_to_host_fn( - [&sends_called](H4PacketWithHci&& h4_packet) { + [&sends_called](H4PacketWithHci&& received_packet) { sends_called++; - emboss::LEReadBufferSizeV1CommandCompleteEventWriter view = + emboss::LEReadBufferSizeV1CommandCompleteEventWriter event_view = MakeEmboss( - h4_packet.GetHciSpan()); + received_packet.GetHciSpan()); // Should reserve 0 credits from original total of 10 (so 10 left for // host). - EXPECT_EQ(view.total_num_le_acl_data_packets().Read(), 10); + EXPECT_EQ(event_view.total_num_le_acl_data_packets().Read(), 10); }); pw::Function send_to_controller_fn( @@ -761,14 +761,14 @@ TEST(ReserveLeAclPackets, ProxyCreditsZeroWhenHostCreditsZero) { uint8_t sends_called = 0; pw::Function send_to_host_fn( - [&sends_called](H4PacketWithHci&& h4_packet) { + [&sends_called](H4PacketWithHci&& received_packet) { sends_called++; - emboss::LEReadBufferSizeV1CommandCompleteEventWriter view = + emboss::LEReadBufferSizeV1CommandCompleteEventWriter event_view = MakeEmboss( - h4_packet.GetHciSpan()); + received_packet.GetHciSpan()); // Should reserve 0 credit from original total of 0 (so 0 left for // host). - EXPECT_EQ(view.total_num_le_acl_data_packets().Read(), 0); + EXPECT_EQ(event_view.total_num_le_acl_data_packets().Read(), 0); }); pw::Function send_to_controller_fn(