Skip to content

Commit ecaa715

Browse files
authored
Merge pull request #492 from HaoboGu/fix/peri_unit_test
Fix unit test for peripheral
2 parents 5947f4b + 6c91391 commit ecaa715

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

.ci/free_disk_space.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
sudo rm -rf /usr/share/dotnet/
6+
sudo rm -rf /usr/local/lib/android

.github/workflows/ci.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
16+
- name: Free disk space
17+
run: |
18+
.ci/free_disk_space.sh
1619
- name: Add dependencies
1720
run: |
1821
sudo apt-get update

host/src/security_manager/pairing/peripheral.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -908,15 +908,15 @@ mod tests {
908908
let pairing_data = pairing.pairing_data.borrow();
909909
let sent_packets = &pairing_ops.sent_packets;
910910

911-
assert!(pairing_data.local_features.responder_key_distribution.identity_key());
911+
assert!(pairing_data.local_features.initiator_key_distribution.identity_key());
912912
assert!(pairing_data.peer_features.initiator_key_distribution.identity_key());
913913

914914
assert_eq!(sent_packets.len(), 1);
915915
assert_eq!(sent_packets[0].command, Command::PairingResponse);
916916
let response_payload = sent_packets[0].payload();
917917
// Check AuthReq and identity key bit in response
918918
assert_eq!(response_payload[2] & 0x09, 0x09);
919-
assert_eq!(response_payload[5] & 0x02, 0x02);
919+
assert_eq!(response_payload[4] & 0x02, 0x02);
920920
}
921921

922922
// Central sends public key, expects peripheral public key followed by peripheral confirm

0 commit comments

Comments
 (0)