diff options
author | 2024-02-15 11:44:24 -0800 | |
---|---|---|
committer | 2024-02-15 19:52:58 +0000 | |
commit | 1f90242d24fd6659af8052d20f0f0889ac82c7a5 (patch) | |
tree | b53e1940fa8e4b9afba1324ebcc6e098b5bc680b | |
parent | 3aff64673bc5b66d2d48e5bbbeed4fef6a651226 (diff) |
Construct a default AdvertisingConfig in tests
Since AdvertisingConfig is a non-aggregate type, it causes an error to initialize
it with a designated initializer list.
Bug: 305066880
Test: mma -j32
Test: bluetooth_test_gd_unit \
--gtest_filter=LeExtendedAdvertisingManagerTest
Flag: EXEMPT, test fix for an infrastructure change
Change-Id: I069b45f8abb2101f1a383dee5761709e631aa792
-rw-r--r-- | system/gd/hci/le_advertising_manager_test.cc | 49 |
1 files changed, 27 insertions, 22 deletions
diff --git a/system/gd/hci/le_advertising_manager_test.cc b/system/gd/hci/le_advertising_manager_test.cc index debd4bb0ed..bf2bcbcffe 100644 --- a/system/gd/hci/le_advertising_manager_test.cc +++ b/system/gd/hci/le_advertising_manager_test.cc @@ -1801,13 +1801,14 @@ TEST_F(LeExtendedAdvertisingManagerTest, use_rpa) { test_acl_manager_->SetAddressPolicy(LeAddressManager::AddressPolicy::USE_RESOLVABLE_ADDRESS); // act: start advertising set with RPA + AdvertisingConfig config{}; + config.requested_advertiser_address_type = AdvertiserAddressType::RESOLVABLE_RANDOM; + config.channel_map = 1; + le_advertising_manager_->ExtendedCreateAdvertiser( kAdvertiserClientIdJni, 0x00, - AdvertisingConfig{ - .requested_advertiser_address_type = AdvertiserAddressType::RESOLVABLE_RANDOM, - .channel_map = 1, - }, + config, scan_callback, set_terminated_callback, 0, @@ -1829,13 +1830,14 @@ TEST_F(LeExtendedAdvertisingManagerTest, use_non_resolvable_address) { test_acl_manager_->SetAddressPolicy(LeAddressManager::AddressPolicy::USE_RESOLVABLE_ADDRESS); // start advertising set with NRPA + AdvertisingConfig config{}; + config.requested_advertiser_address_type = AdvertiserAddressType::NONRESOLVABLE_RANDOM; + config.channel_map = 1; + le_advertising_manager_->ExtendedCreateAdvertiser( kAdvertiserClientIdJni, 0x00, - AdvertisingConfig{ - .requested_advertiser_address_type = AdvertiserAddressType::NONRESOLVABLE_RANDOM, - .channel_map = 1, - }, + config, scan_callback, set_terminated_callback, 0, @@ -1866,13 +1868,14 @@ TEST_F(LeExtendedAdvertisingManagerTest, use_public_address_type_if_public_addre test_acl_manager_->SetAddressPolicy(LeAddressManager::AddressPolicy::USE_PUBLIC_ADDRESS); // act: start advertising set with RPA + AdvertisingConfig config{}; + config.requested_advertiser_address_type = AdvertiserAddressType::RESOLVABLE_RANDOM; + config.channel_map = 1; + le_advertising_manager_->ExtendedCreateAdvertiser( kAdvertiserClientIdJni, 0x00, - AdvertisingConfig{ - .requested_advertiser_address_type = AdvertiserAddressType::RESOLVABLE_RANDOM, - .channel_map = 1, - }, + config, scan_callback, set_terminated_callback, 0, @@ -1898,14 +1901,15 @@ TEST_F_WITH_FLAGS( test_acl_manager_->SetAddressPolicy(LeAddressManager::AddressPolicy::USE_PUBLIC_ADDRESS); // act: start non-connectable advertising set with RPA + AdvertisingConfig config{}; + config.requested_advertiser_address_type = AdvertiserAddressType::RESOLVABLE_RANDOM; + config.channel_map = 1; + config.connectable = false; + le_advertising_manager_->ExtendedCreateAdvertiser( kAdvertiserClientIdJni, 0x00, - AdvertisingConfig{ - .requested_advertiser_address_type = AdvertiserAddressType::RESOLVABLE_RANDOM, - .channel_map = 1, - .connectable = false, - }, + config, scan_callback, set_terminated_callback, 0, @@ -1938,14 +1942,15 @@ TEST_F_WITH_FLAGS( test_acl_manager_->SetAddressPolicy(LeAddressManager::AddressPolicy::USE_PUBLIC_ADDRESS); // act: start non-connectable advertising set with PUBLIC + AdvertisingConfig config{}; + config.requested_advertiser_address_type = AdvertiserAddressType::PUBLIC; + config.channel_map = 1; + config.connectable = false; + le_advertising_manager_->ExtendedCreateAdvertiser( kAdvertiserClientIdJni, 0x00, - AdvertisingConfig{ - .requested_advertiser_address_type = AdvertiserAddressType::PUBLIC, - .channel_map = 1, - .connectable = false, - }, + config, scan_callback, set_terminated_callback, 0, |