|
5 | 5 | #include "services/ble/test_doubles/GapCentralMock.hpp"
|
6 | 6 | #include "services/ble/test_doubles/GapCentralObserverMock.hpp"
|
7 | 7 | #include "gmock/gmock.h"
|
8 |
| -#include <chrono> |
9 | 8 |
|
10 | 9 | namespace services
|
11 | 10 | {
|
@@ -49,7 +48,7 @@ namespace services
|
49 | 48 |
|
50 | 49 | TEST_F(GapCentralDecoratorTest, forward_device_discovered_event_to_observers)
|
51 | 50 | {
|
52 |
| - GapAdvertisingReport deviceDiscovered{ GapAdvertisingEventType::advInd, GapAdvertisingEventAddressType::publicDeviceAddress, hal::MacAddress{ 0, 1, 2, 3, 4, 5 }, infra::BoundedVector<uint8_t>::WithMaxSize<GapPeripheral::maxAdvertisementDataSize>{}, -75 }; |
| 51 | + GapAdvertisingReport deviceDiscovered{ GapAdvertisingEventType::advInd, GapDeviceAddressType::publicAddress, hal::MacAddress{ 0, 1, 2, 3, 4, 5 }, infra::BoundedVector<uint8_t>::WithMaxSize<GapPeripheral::maxAdvertisementDataSize>{}, -75 }; |
53 | 52 |
|
54 | 53 | EXPECT_CALL(gapObserver, DeviceDiscovered(ObjectContentsEqual(deviceDiscovered)));
|
55 | 54 |
|
@@ -80,6 +79,13 @@ namespace services
|
80 | 79 |
|
81 | 80 | EXPECT_CALL(gap, StopDeviceDiscovery());
|
82 | 81 | decorator.StopDeviceDiscovery();
|
| 82 | + |
| 83 | + hal::MacAddress mac = { 0x00, 0x1A, 0x7D, 0xDA, 0x71, 0x13 }; |
| 84 | + EXPECT_CALL(gap, ResolvePrivateAddress(mac)).WillOnce(testing::Return(infra::none)); |
| 85 | + EXPECT_EQ(decorator.ResolvePrivateAddress(mac), infra::none); |
| 86 | + |
| 87 | + EXPECT_CALL(gap, ResolvePrivateAddress(mac)).WillOnce(testing::Return(infra::MakeOptional(mac))); |
| 88 | + EXPECT_EQ(decorator.ResolvePrivateAddress(mac), mac); |
83 | 89 | }
|
84 | 90 |
|
85 | 91 | TEST(GapAdvertisingDataParserTest, payload_too_small)
|
@@ -167,14 +173,11 @@ namespace services
|
167 | 173 | {
|
168 | 174 | infra::StringOutputStream::WithStorage<128> stream;
|
169 | 175 |
|
170 |
| - services::GapAdvertisingEventAddressType eventAddressTypePublicDevice = services::GapAdvertisingEventAddressType::publicDeviceAddress; |
171 |
| - services::GapAdvertisingEventAddressType eventAddressTypeRandomDevice = services::GapAdvertisingEventAddressType::randomDeviceAddress; |
172 |
| - services::GapAdvertisingEventAddressType eventAddressTypePublicIdentity = services::GapAdvertisingEventAddressType::publicIdentityAddress; |
173 |
| - services::GapAdvertisingEventAddressType eventAddressTypeRandomIdentity = services::GapAdvertisingEventAddressType::randomIdentityAddress; |
174 |
| - |
175 |
| - stream << eventAddressTypePublicDevice << " " << eventAddressTypeRandomDevice << " " << eventAddressTypePublicIdentity << " " << eventAddressTypeRandomIdentity; |
| 176 | + services::GapDeviceAddressType eventAddressTypePublicDevice = services::GapDeviceAddressType::publicAddress; |
| 177 | + services::GapDeviceAddressType eventAddressTypeRandomDevice = services::GapDeviceAddressType::randomAddress; |
| 178 | + stream << eventAddressTypePublicDevice << " " << eventAddressTypeRandomDevice; |
176 | 179 |
|
177 |
| - EXPECT_EQ("Public Device Address Random Device Address Public Identity Address Random Identity Address", stream.Storage()); |
| 180 | + EXPECT_EQ("Public Device Address Random Device Address", stream.Storage()); |
178 | 181 | }
|
179 | 182 |
|
180 | 183 | TEST(GapInsertionOperatorStateTest, state_overload_operator)
|
|
0 commit comments