Skip to content

Commit

Permalink
pw_bluetooth_proxy: De-shadow variable names
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: David Rees <[email protected]>
Reviewed-by: Ben Lawson <[email protected]>
Lint: Lint 🤖 <[email protected]>
  • Loading branch information
acsaeed authored and CQ Bot Account committed Aug 28, 2024
1 parent f2e01c4 commit e5058d9
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions pw_bluetooth_proxy/proxy_host_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -589,14 +589,14 @@ TEST(ReserveLeAclCredits, ProxyCreditsReserveCreditsWithLEReadBufferSizeV1) {

uint8_t sends_called = 0;
pw::Function<void(H4PacketWithHci && packet)> send_to_host_fn(
[&sends_called](H4PacketWithHci&& h4_packet) {
[&sends_called](H4PacketWithHci&& received_packet) {
sends_called++;
emboss::LEReadBufferSizeV1CommandCompleteEventWriter view =
emboss::LEReadBufferSizeV1CommandCompleteEventWriter event_view =
MakeEmboss<emboss::LEReadBufferSizeV1CommandCompleteEventWriter>(
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<void(H4PacketWithH4 && packet)> send_to_controller_fn(
Expand Down Expand Up @@ -633,14 +633,14 @@ TEST(ReserveLeAclCredits, ProxyCreditsReserveCreditsWithLEReadBufferSizeV2) {

uint8_t sends_called = 0;
pw::Function<void(H4PacketWithHci && packet)> send_to_host_fn(
[&sends_called](H4PacketWithHci&& h4_packet) {
[&sends_called](H4PacketWithHci&& received_packet) {
sends_called++;
emboss::LEReadBufferSizeV2CommandCompleteEventWriter view =
emboss::LEReadBufferSizeV2CommandCompleteEventWriter event_view =
MakeEmboss<emboss::LEReadBufferSizeV2CommandCompleteEventWriter>(
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<void(H4PacketWithH4 && packet)> send_to_controller_fn(
Expand Down Expand Up @@ -677,14 +677,14 @@ TEST(ReserveLeAclCredits, ProxyCreditsCappedByControllerCredits) {

uint8_t sends_called = 0;
pw::Function<void(H4PacketWithHci && packet)> 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<emboss::LEReadBufferSizeV1CommandCompleteEventWriter>(
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<void(H4PacketWithH4 && packet)> send_to_controller_fn(
Expand Down Expand Up @@ -718,14 +718,14 @@ TEST(ReserveLeAclCredits, ProxyCreditsReserveZeroCredits) {

uint8_t sends_called = 0;
pw::Function<void(H4PacketWithHci && packet)> send_to_host_fn(
[&sends_called](H4PacketWithHci&& h4_packet) {
[&sends_called](H4PacketWithHci&& received_packet) {
sends_called++;
emboss::LEReadBufferSizeV1CommandCompleteEventWriter view =
emboss::LEReadBufferSizeV1CommandCompleteEventWriter event_view =
MakeEmboss<emboss::LEReadBufferSizeV1CommandCompleteEventWriter>(
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<void(H4PacketWithH4 && packet)> send_to_controller_fn(
Expand Down Expand Up @@ -761,14 +761,14 @@ TEST(ReserveLeAclPackets, ProxyCreditsZeroWhenHostCreditsZero) {

uint8_t sends_called = 0;
pw::Function<void(H4PacketWithHci && packet)> send_to_host_fn(
[&sends_called](H4PacketWithHci&& h4_packet) {
[&sends_called](H4PacketWithHci&& received_packet) {
sends_called++;
emboss::LEReadBufferSizeV1CommandCompleteEventWriter view =
emboss::LEReadBufferSizeV1CommandCompleteEventWriter event_view =
MakeEmboss<emboss::LEReadBufferSizeV1CommandCompleteEventWriter>(
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<void(H4PacketWithH4 && packet)> send_to_controller_fn(
Expand Down

0 comments on commit e5058d9

Please sign in to comment.