Home
last modified time | relevance | path

Searched refs:Optional (Results 1 – 25 of 65) sorted by relevance

123

/system/chre/util/include/chre/util/
Doptional_impl.h28 Optional<ObjectType>::Optional(const ObjectType &object) { in Optional() function
34 Optional<ObjectType>::Optional(ObjectType &&object) { in Optional() function
40 Optional<ObjectType>::~Optional() { in ~Optional()
45 bool Optional<ObjectType>::has_value() const { in has_value()
50 void Optional<ObjectType>::reset() { in reset()
58 ObjectType &Optional<ObjectType>::value() { in value()
63 const ObjectType &Optional<ObjectType>::value() const { in value()
68 Optional<ObjectType> &Optional<ObjectType>::operator=(ObjectType &&other) {
80 Optional<ObjectType> &Optional<ObjectType>::operator=(
81 Optional<ObjectType> &&other) {
[all …]
Doptional.h29 class Optional {
39 Optional() = default;
46 Optional(const Optional<ObjectType> &object) = default;
53 Optional(Optional<ObjectType> &object) = default;
60 Optional(const ObjectType &object);
67 Optional(ObjectType &&object);
73 ~Optional();
101 Optional<ObjectType> &operator=(ObjectType &&other);
111 Optional<ObjectType> &operator=(Optional<ObjectType> &&other);
120 Optional<ObjectType> &operator=(const ObjectType &other);
[all …]
/system/chre/util/tests/
Doptional_test.cc23 using chre::Optional;
41 TEST(Optional, ShouldDestructContainedObject) { in TEST() argument
44 Optional<DestructorTestingObject> object(DestructorTestingObject{}); in TEST()
50 TEST(Optional, NoValueByDefault) { in TEST() argument
51 Optional<int> myInt; in TEST()
55 TEST(Optional, NonDefaultValueByDefault) { in TEST() argument
56 Optional<int> myInt(0x1337); in TEST()
61 TEST(Optional, NonDefaultMovedValueByDefault) { in TEST() argument
62 Optional<int> myInt(std::move(0x1337)); in TEST()
67 TEST(Optional, CopyConstruct) { in TEST() argument
[all …]
/system/bt/gd/storage/
Dconfig_cache_helper_test.cc37 ASSERT_THAT(config.GetProperty("A", "B"), Optional(StrEq("true"))); in TEST()
38 ASSERT_THAT(ConfigCacheHelper(config).GetBool("A", "B"), Optional(IsTrue())); in TEST()
41 ASSERT_THAT(config.GetProperty("A", "B"), Optional(StrEq("false"))); in TEST()
42 ASSERT_THAT(ConfigCacheHelper(config).GetBool("A", "B"), Optional(IsFalse())); in TEST()
49 ASSERT_THAT(config.GetProperty("A", "B"), Optional(StrEq("123"))); in TEST()
50 ASSERT_THAT(ConfigCacheHelper(config).GetUint64("A", "B"), Optional(Eq(uint64_t(123)))); in TEST()
55 …ASSERT_THAT(config.GetProperty("A", "B"), Optional(StrEq(std::to_string(std::numeric_limits<int>::… in TEST()
56 ASSERT_THAT(ConfigCacheHelper(config).GetUint64("A", "B"), Optional(Eq(num))); in TEST()
59 ASSERT_THAT(config.GetProperty("A", "B"), Optional(StrEq("0"))); in TEST()
60 ASSERT_THAT(ConfigCacheHelper(config).GetUint64("A", "B"), Optional(Eq(0))); in TEST()
[all …]
Dlegacy_config_file_test.cc54 EXPECT_THAT(config_read->GetProperty("A", "B"), Optional(StrEq("C"))); in TEST()
55 …EXPECT_THAT(config_read->GetProperty("CC:DD:EE:FF:00:11", "LinkKey"), Optional(StrEq("AABBAABBCCDD… in TEST()
89 EXPECT_THAT(config_read->GetProperty("Info", "FileSource"), Optional(StrEq("Empty"))); in TEST()
90 EXPECT_THAT(config_read->GetProperty("Info", "FileSource"), Optional(StrEq("Empty"))); in TEST()
92 …config_read->GetProperty("01:02:03:ab:cd:ea", "LinkKey"), Optional(StrEq("fedcba0987654321fedcba09… in TEST()
122 EXPECT_THAT(ReadSmallFile(temp_config.string()), Optional(StrEq(kWriteTestConfig))); in TEST()
178 …EXPECT_THAT(config_read->GetProperty(ConfigCache::kDefaultSectionName, "first_key"), Optional(StrE… in TEST()
180 EXPECT_THAT(config_read->GetProperty("DID", "primaryRecord"), Optional(StrEq("true"))); in TEST()
182 EXPECT_THAT(config_read->GetProperty("DID", "version"), Optional(StrEq("0x1436"))); in TEST()
Ddevice_test.cc34 using ::testing::Optional;
52 ASSERT_THAT(device2.GetName(), Optional(StrEq("hello"))); in TEST()
59 ASSERT_THAT(device3.GetName(), Optional(StrEq("hello"))); in TEST()
77 ASSERT_THAT(device2.GetName(), Optional(StrEq("hello"))); in TEST()
84 ASSERT_THAT(device3.GetName(), Optional(StrEq("hello"))); in TEST()
106 ASSERT_THAT(device2.GetName(), Optional(StrEq("hello"))); in TEST()
120 ASSERT_THAT(device.GetName(), Optional(StrEq("hello world!"))); in TEST()
135 ASSERT_THAT(device.GetDeviceType(), Optional(Eq(DeviceType::BR_EDR))); in TEST()
141 ASSERT_THAT(device.GetDeviceType(), Optional(Eq(DeviceType::DUAL))); in TEST()
159 ASSERT_THAT(device.GetDeviceType(), Optional(Eq(DeviceType::BR_EDR))); in TEST()
[all …]
Dstorage_module_test.cc151 …operty(StorageModule::kInfoSection, StorageModule::kFileSourceProperty), Optional(StrEq("Empty"))); in TEST_F()
222 Optional(StrEq("01:02:03:ab:cd:ef"))); in TEST_F()
250 …storage->GetConfigCachePublic()->GetProperty("01:02:03:ab:cd:ea", "name"), Optional(StrEq("hello w… in TEST_F()
252 …ASSERT_THAT(storage->GetConfigCachePublic()->GetProperty("01:02:03:ab:cd:ea", "name"), Optional(St… in TEST_F()
256 ASSERT_THAT(config->GetProperty("01:02:03:ab:cd:ea", "name"), Optional(StrEq("foo"))); in TEST_F()
315 ASSERT_THAT(storage->GetAdapterConfig().GetAddress(), Optional(Eq(address))); in TEST_F()
Dadapter_config_test.cc31 using ::testing::Optional;
49 ASSERT_THAT(adapter_config.GetAddress(), Optional(Eq(address))); in TEST()
Dle_device_test.cc34 using ::testing::Optional;
53 ASSERT_THAT(device.GetAddressType(), Optional(Eq(AddressType::RANDOM_DEVICE_ADDRESS))); in TEST()
Dclassic_device_test.cc34 using ::testing::Optional;
53 ASSERT_THAT(device.GetLinkKey(), Optional(Eq(kExampleLinkKey))); in TEST()
Dconfig_cache_test.cc153 ASSERT_THAT(value, Optional(StrEq("E"))); in TEST()
232 …ASSERT_THAT(config.GetProperty(GetTestAddress(i), "Name"), Optional(StrEq("Hello" + std::to_string… in TEST()
235 …ASSERT_THAT(config.GetProperty(GetTestAddress(i), "Name"), Optional(StrEq("Hello" + std::to_string… in TEST()
286 Optional(StrEq(std::to_string(bluetooth::hci::DeviceType::BR_EDR)))); in TEST()
293 Optional(StrEq(std::to_string(bluetooth::hci::DeviceType::BR_EDR)))); in TEST()
298 Optional(StrEq(std::to_string(bluetooth::hci::DeviceType::DUAL)))); in TEST()
303 Optional(StrEq(std::to_string(bluetooth::hci::DeviceType::LE)))); in TEST()
/system/bt/gd/common/
Dstrings_test.cc131 …ASSERT_THAT(FromHexString("aabbccdd1122"), Optional(ElementsAre(0xaa, 0xbb, 0xcc, 0xdd, 0x11, 0x22… in TEST()
133 ASSERT_THAT(FromHexString(""), Optional(IsEmpty())); in TEST()
135 ASSERT_THAT(FromHexString("aa"), Optional(ElementsAre(0xaa))); in TEST()
137 ASSERT_THAT(FromHexString("0605560b"), Optional(ElementsAre(0x6, 0x5, 0x56, 0xb))); in TEST()
139 ASSERT_THAT(FromHexString("AABBCC"), Optional(ElementsAre(0xaa, 0xbb, 0xcc))); in TEST()
141 ASSERT_THAT(FromHexString("aAbbCC"), Optional(ElementsAre(0xaa, 0xbb, 0xcc))); in TEST()
149 ASSERT_THAT(Int64FromString("42"), Optional(Eq(int64_t(42)))); in TEST()
150 ASSERT_THAT(Int64FromString("-42"), Optional(Eq(int64_t(-42)))); in TEST()
151 ASSERT_THAT(Int64FromString("0"), Optional(Eq(int64_t(0)))); in TEST()
162 ASSERT_THAT(Int64FromString("2147483648"), Optional(Eq(int64_t(2147483648)))); in TEST()
[all …]
/system/bt/btif/test/
Dbtif_config_cache_test.cc174 Optional(StrEq("Headset_1"))); in TEST()
179 Optional(Eq(65536))); in TEST()
184 Optional(Eq(uint64_t(4294967296)))); in TEST()
189 Optional(IsTrue())); in TEST()
195 Optional(StrEq(""))); in TEST()
207 Optional(StrEq("Headset_1"))); in TEST()
212 Optional(Eq(65536))); in TEST()
217 Optional(Eq(uint64_t(4294967296)))); in TEST()
222 Optional(IsTrue())); in TEST()
235 Optional(StrEq(""))); in TEST()
[all …]
/system/chre/apps/test/common/chre_stress_test/inc/
Dchre_stress_test_manager.h145 Optional<AsyncRequest> &request,
165 Optional<uint16_t> mHostEndpoint;
193 Optional<AsyncRequest> mWifiScanAsyncRequest;
194 Optional<AsyncRequest> mGnssLocationAsyncRequest;
195 Optional<AsyncRequest> mGnssMeasurementAsyncRequest;
196 Optional<AsyncRequest> mWwanCellInfoAsyncRequest;
/system/nvram/messages/include/nvram/messages/
Doptional.h24 template <typename ValueType> class Optional {
26 Optional() = default;
27 explicit Optional(ValueType value) : value_(value), valid_(true) {} in Optional() function
/system/bt/gd/os/linux_generic/
Dfiles_test.cc46 EXPECT_THAT(ReadSmallFile(temp_file.string()), Optional(StrEq(text))); in TEST()
50 EXPECT_THAT(ReadSmallFile(to_file.string()), Optional(StrEq(text))); in TEST()
60 EXPECT_THAT(ReadSmallFile(temp_file.string()), Optional(StrEq(text))); in TEST()
69 EXPECT_THAT(ReadSmallFile(temp_file.string()), Optional(StrEq(text))); in TEST()
72 EXPECT_THAT(ReadSmallFile(temp_file.string()), Optional(StrEq(text))); in TEST()
81 EXPECT_THAT(ReadSmallFile(temp_file.string()), Optional(StrEq(text))); in TEST()
Dwakelock_manager_unittest.cc108 ASSERT_THAT(os_callouts.GetNetAcquiredCount(WakelockManager::kBtWakelockId), Optional(Eq(1))); in TEST_F()
113 ASSERT_THAT(os_callouts.GetNetAcquiredCount(WakelockManager::kBtWakelockId), Optional(Eq(2))); in TEST_F()
117 ASSERT_THAT(os_callouts.GetNetAcquiredCount(WakelockManager::kBtWakelockId), Optional(Eq(1))); in TEST_F()
134 ASSERT_THAT(os_callouts.GetNetAcquiredCount(WakelockManager::kBtWakelockId), Optional(Eq(1))); in TEST_F()
139 ASSERT_THAT(os_callouts.GetNetAcquiredCount(WakelockManager::kBtWakelockId), Optional(Eq(0))); in TEST_F()
144 ASSERT_THAT(os_callouts.GetNetAcquiredCount(WakelockManager::kBtWakelockId), Optional(Eq(-1))); in TEST_F()
162 ASSERT_THAT(os_callouts.GetNetAcquiredCount(WakelockManager::kBtWakelockId), Optional(Eq(1))); in TEST_F()
165 ASSERT_THAT(os_callouts.GetNetAcquiredCount(WakelockManager::kBtWakelockId), Optional(Eq(0))); in TEST_F()
/system/extras/simpleperf/scripts/
Dsimpleperf_utils.py32 from typing import Dict, Iterator, List, Optional, Set, Union
103 def bytes_to_str(bytes_value: Optional[bytes]) -> str:
193 def find_ndk_and_sdk_paths(cls, ndk_path: Optional[str] = None
194 ) -> Iterator[Tuple[Optional[str], Optional[str]]]:
226 def find_sdk_path(cls, ndk_path: str) -> Optional[str]:
235 def _get_binutils_path_in_ndk(cls, toolname: str, arch: Optional[str], platform: str
253 def find_tool_path(cls, toolname: str, ndk_path: Optional[str] = None,
254 arch: Optional[str] = None) -> Optional[str]:
317 self.serial_number: Optional[str] = None
386 def get_property(self, name: str) -> Optional[str]:
[all …]
Dsimpleperf_report_lib.py27 from typing import Any, Dict, List, Optional, Union
32 def _is_null(p: Optional[ct._Pointer]) -> bool:
238 def __init__(self, native_lib_path: Optional[str] = None):
273 self.meta_info: Optional[Dict[str, str]] = None
274 self.current_sample: Optional[SampleStruct] = None
275 self.record_cmd: Optional[str] = None
333 def GetNextSample(self) -> Optional[SampleStruct]:
342 def GetCurrentSample(self) -> Optional[SampleStruct]:
360 def GetTracingDataOfCurrentSample(self) -> Optional[Dict[str, Any]]:
/system/tools/hidl/test/utils_test/
Dmain.cpp27 using ::testing::Optional;
199 Optional(Property(&FqInstance::string, "android.hardware.foo@1.0::IFoo/default"))); in TEST()
201 Optional(Property(&FqInstance::string, "android.hardware.foo@1.0::IFoo"))); in TEST()
203 Optional(Property(&FqInstance::string, "android.hardware.foo@1.0"))); in TEST()
205 Optional(Property(&FqInstance::string, "@1.0::IFoo/default"))); in TEST()
207 Optional(Property(&FqInstance::string, "@1.0::IFoo"))); in TEST()
209 Optional(Property(&FqInstance::string, "IFoo/default"))); in TEST()
/system/chre/apps/test/common/chre_settings_test/inc/
Dchre_settings_test_manager.h169 chre::Optional<TestSession> mTestSession;
172 chre::Optional<chreWifiRangingTarget> mCachedRangingTarget;
/system/apex/tests/src/com/android/tests/apex/
DTimezoneDataHostTest.java35 import java.util.Optional;
87 Optional<DebugEntryProto> matchingEntry = in assertEntryValue()
/system/extras/simpleperf/scripts/test/
Ddo_test.py39 from typing import List, Optional
98 test_from: Optional[str],
99 test_pattern: Optional[List[str]]) -> List[str]:
113 def get_test_type(test: str) -> Optional[str]:
205 device: Optional[Device],
215 self.parent_conn: Optional[mp.connection.Connection] = None
216 self.proc: Optional[mp.Process] = None
366 self.progress_bar: Optional[ProgressBar] = None
367 self.test_summary: Optional[TestSummary] = None
Dtest_utils.py28 from typing import List, Optional
41 cls, test_dir: str, testdata_dir: str, use_browser: bool, ndk_path: Optional[str],
42 device_serial_number: Optional[str],
43 progress_conn: Optional[Connection]):
/system/chre/core/include/chre/core/
Ddebug_dump_manager.h57 Optional<uint32_t> mLastNanoappId;

123