hardware/interfaces
修订版 | c7c333931cb4dc6e0f75da865d052f43828e1f17 (tree) |
---|---|
时间 | 2017-09-07 22:41:58 |
作者 | Myles Watson <mylesgw@goog...> |
Commiter | Myles Watson |
Bluetooth: Remove credit check from Loopback tests
The Bluetooth specification doesn't require data credits
to come back within a specific timeframe, so the VTS test
can not require it.
Bug: 65269854
Test: VtsHalBlueoothV1_0TargetTest with simulated chip (no credits)
Change-Id: If2fc052d3b5236f6a3097f3d5403882226561404
(cherry picked from commit 0e06a63c76f4c02ac307c6294f3d6f61ae6406e7)
@@ -464,8 +464,9 @@ void BluetoothHidlTest::sendAndCheckACL(int num_packets, size_t size, | ||
464 | 464 | |
465 | 465 | // Return the number of completed packets reported by the controller. |
466 | 466 | int BluetoothHidlTest::wait_for_completed_packets_event(uint16_t handle) { |
467 | - EXPECT_TRUE(bluetooth_cb->WaitForCallback(kCallbackNameHciEventReceived) | |
468 | - .no_timeout); | |
467 | + if (!bluetooth_cb->WaitForCallback(kCallbackNameHciEventReceived).no_timeout) { | |
468 | + ALOGW("%s: WaitForCallback timed out.", __func__); | |
469 | + } | |
469 | 470 | int packets_processed = 0; |
470 | 471 | while (event_queue.size() > 0) { |
471 | 472 | hidl_vec<uint8_t> event = event_queue.front(); |
@@ -604,20 +605,24 @@ TEST_F(BluetoothHidlTest, LoopbackModeSinglePackets) { | ||
604 | 605 | |
605 | 606 | // This should work, but breaks on some current platforms. Figure out how to |
606 | 607 | // grandfather older devices but test new ones. |
607 | - int sco_packets_sent = 0; | |
608 | 608 | if (0 && sco_connection_handles.size() > 0) { |
609 | 609 | sendAndCheckSCO(1, max_sco_data_packet_length, sco_connection_handles[0]); |
610 | - sco_packets_sent = 1; | |
611 | - EXPECT_EQ(sco_packets_sent, | |
612 | - wait_for_completed_packets_event(sco_connection_handles[0])); | |
610 | + int sco_packets_sent = 1; | |
611 | + int completed_packets = wait_for_completed_packets_event(sco_connection_handles[0]); | |
612 | + if (sco_packets_sent != completed_packets) { | |
613 | + ALOGW("%s: packets_sent (%d) != completed_packets (%d)", __func__, sco_packets_sent, | |
614 | + completed_packets); | |
615 | + } | |
613 | 616 | } |
614 | 617 | |
615 | - int acl_packets_sent = 0; | |
616 | 618 | if (acl_connection_handles.size() > 0) { |
617 | 619 | sendAndCheckACL(1, max_acl_data_packet_length, acl_connection_handles[0]); |
618 | - acl_packets_sent = 1; | |
619 | - EXPECT_EQ(acl_packets_sent, | |
620 | - wait_for_completed_packets_event(acl_connection_handles[0])); | |
620 | + int acl_packets_sent = 1; | |
621 | + int completed_packets = wait_for_completed_packets_event(acl_connection_handles[0]); | |
622 | + if (acl_packets_sent != completed_packets) { | |
623 | + ALOGW("%s: packets_sent (%d) != completed_packets (%d)", __func__, acl_packets_sent, | |
624 | + completed_packets); | |
625 | + } | |
621 | 626 | } |
622 | 627 | } |
623 | 628 |
@@ -633,22 +638,26 @@ TEST_F(BluetoothHidlTest, LoopbackModeBandwidth) { | ||
633 | 638 | |
634 | 639 | // This should work, but breaks on some current platforms. Figure out how to |
635 | 640 | // grandfather older devices but test new ones. |
636 | - int sco_packets_sent = 0; | |
637 | 641 | if (0 && sco_connection_handles.size() > 0) { |
638 | 642 | sendAndCheckSCO(NUM_SCO_PACKETS_BANDWIDTH, max_sco_data_packet_length, |
639 | 643 | sco_connection_handles[0]); |
640 | - sco_packets_sent = NUM_SCO_PACKETS_BANDWIDTH; | |
641 | - EXPECT_EQ(sco_packets_sent, | |
642 | - wait_for_completed_packets_event(sco_connection_handles[0])); | |
644 | + int sco_packets_sent = NUM_SCO_PACKETS_BANDWIDTH; | |
645 | + int completed_packets = wait_for_completed_packets_event(sco_connection_handles[0]); | |
646 | + if (sco_packets_sent != completed_packets) { | |
647 | + ALOGW("%s: packets_sent (%d) != completed_packets (%d)", __func__, sco_packets_sent, | |
648 | + completed_packets); | |
649 | + } | |
643 | 650 | } |
644 | 651 | |
645 | - int acl_packets_sent = 0; | |
646 | 652 | if (acl_connection_handles.size() > 0) { |
647 | 653 | sendAndCheckACL(NUM_ACL_PACKETS_BANDWIDTH, max_acl_data_packet_length, |
648 | 654 | acl_connection_handles[0]); |
649 | - acl_packets_sent = NUM_ACL_PACKETS_BANDWIDTH; | |
650 | - EXPECT_EQ(acl_packets_sent, | |
651 | - wait_for_completed_packets_event(acl_connection_handles[0])); | |
655 | + int acl_packets_sent = NUM_ACL_PACKETS_BANDWIDTH; | |
656 | + int completed_packets = wait_for_completed_packets_event(acl_connection_handles[0]); | |
657 | + if (acl_packets_sent != completed_packets) { | |
658 | + ALOGW("%s: packets_sent (%d) != completed_packets (%d)", __func__, acl_packets_sent, | |
659 | + completed_packets); | |
660 | + } | |
652 | 661 | } |
653 | 662 | } |
654 | 663 |