Home
last modified time | relevance | path

Searched refs:vec (Results 1 – 25 of 188) sorted by relevance

12345678

/packages/modules/Bluetooth/system/rust/src/gatt/server/transactions/helpers/
Datt_filter_by_size_type.rs35 let mut out = vec![]; in filter_read_attributes_by_size_type()
92 let db = TestAttDatabase::new(vec![( in test_single_matching_attr()
98 vec![4, 5], in test_single_matching_attr()
113 vec![AttributeWithValue { in test_single_matching_attr()
123 let db = TestAttDatabase::new(vec![ in test_skip_mismatching_attrs()
130 vec![4, 5], in test_skip_mismatching_attrs()
138 vec![5, 6], in test_skip_mismatching_attrs()
146 vec![6, 7], in test_skip_mismatching_attrs()
162 vec![ in test_skip_mismatching_attrs()
178 let db = TestAttDatabase::new(vec![ in test_stop_once_length_changes()
[all …]
/packages/modules/StatsD/statsd/benchmark/
Ddata_structures_benchmark.cpp29 void benchmarkFunctionForVector(std::vector<ContainerType>& vec, int capacity) { in benchmarkFunctionForVector() argument
32 vec[i] = !result; in benchmarkFunctionForVector()
38 resultInt += vec[i]; in benchmarkFunctionForVector()
42 benchmark::DoNotOptimize(vec); in benchmarkFunctionForVector()
47 void benchmarkStdFillForVector(std::vector<ContainerType>& vec, int capacity) { in benchmarkStdFillForVector() argument
48 std::fill(vec.begin(), vec.end(), true); in benchmarkStdFillForVector()
51 resultInt += vec[i]; in benchmarkStdFillForVector()
55 benchmark::DoNotOptimize(vec); in benchmarkStdFillForVector()
63 std::vector<bool> vec(capacity); in BM_BasicVectorBoolUsage() local
66 benchmarkFunctionForVector<bool>(vec, capacity); in BM_BasicVectorBoolUsage()
[all …]
/packages/modules/adb/
Dtypes_test.cpp137 IOVector vec; in TEST() local
139 vec.append(create_block('x', 2)); in TEST()
140 vec.append(create_block('y', 1000)); in TEST()
141 ASSERT_EQ(2U, vec.front_size()); in TEST()
142 ASSERT_EQ(1002U, vec.size()); in TEST()
144 vec.drop_front(1); in TEST()
145 ASSERT_EQ(1U, vec.front_size()); in TEST()
146 ASSERT_EQ(1001U, vec.size()); in TEST()
148 vec.drop_front(1); in TEST()
149 ASSERT_EQ(1000U, vec.front_size()); in TEST()
[all …]
/packages/modules/Bluetooth/system/gd/rust/linux/dbus_projection/tests/
Dconversions.rs75 .flat_map(|(k, v)| vec![k as &dyn RefArg, v as &dyn RefArg].into_iter()), in as_iter()
109 items: vec![ in test_dbus_propmap_success()
115 items: vec![( in test_dbus_propmap_success()
121 (String::from("bytes"), wrap_variant(vec![1 as u8, 2, 3])), in test_dbus_propmap_success()
125 (String::from("key-0"), Box::new(vec![5, 6, 7, 8])), in test_dbus_propmap_success()
126 (String::from("key-1"), Box::new(vec![-5, -6, -7, -8])), in test_dbus_propmap_success()
131 wrap_variant(vec![ in test_dbus_propmap_success()
132 vec![ in test_dbus_propmap_success()
137 vec![String::from("string 1"), String::from("string 2")], in test_dbus_propmap_success()
142 wrap_variant(vec![FakeDictionary { in test_dbus_propmap_success()
[all …]
/packages/modules/Bluetooth/system/gd/common/
Dcircular_buffer_test.cc41 auto vec = buffer.Pull(); in TEST() local
43 ASSERT_STREQ("One", vec[0].entry.c_str()); in TEST()
44 ASSERT_STREQ("Two", vec[1].entry.c_str()); in TEST()
45 ASSERT_STREQ("Three", vec[2].entry.c_str()); in TEST()
59 auto vec = buffer.Drain(); in TEST() local
61 ASSERT_STREQ("One", vec[0].entry.c_str()); in TEST()
62 ASSERT_STREQ("Two", vec[1].entry.c_str()); in TEST()
63 ASSERT_STREQ("Three", vec[2].entry.c_str()); in TEST()
78 auto vec = buffer.Pull(); in TEST() local
80 for (auto v : vec) { in TEST()
[all …]
Dsync_map_count.h37 std::vector<Item> vec; in Vectorize() local
39 vec.push_back(Item{it.first, it.second}); in Vectorize()
41 return vec; in Vectorize()
45 std::vector<Item> vec = Vectorize(); in GetSorted() local
46 …sort(vec.begin(), vec.end(), [=](const Item& a, const Item& b) -> bool { return sort_func(a, b); }… in GetSorted()
47 return vec; in GetSorted()
Dbyte_array.h82 auto vec = common::FromHexString(from); in FromString() local
83 if (!vec) { in FromString()
87 std::move(vec->data(), vec->data() + vec->size(), byte_array.data()); in FromString()
/packages/modules/Bluetooth/system/gd/rust/linux/utils/src/
Dadv_parser.rs118 let payload: Vec<u8> = vec![ in test_extract_flags()
147 let payload: Vec<u8> = vec![2, FLAGS, 3]; in test_extract_service_uuids()
151 let payload: Vec<u8> = vec![ in test_extract_service_uuids()
205 let payload: Vec<u8> = vec![2, FLAGS, 3]; in test_extract_name()
209 let payload: Vec<u8> = vec![2, FLAGS, 3, 5, COMPLETE_LOCAL_NAME, 116, 101, 115, 116]; in test_extract_name()
213 let payload: Vec<u8> = vec![2, FLAGS, 3, 5, SHORTENED_LOCAL_NAME, 116, 101, 115, 116]; in test_extract_name()
220 let payload: Vec<u8> = vec![2, FLAGS, 3]; in test_extract_service_data()
224 let payload: Vec<u8> = vec![ in test_extract_service_data()
281 assert_eq!(service_data.get(&expected_uuid), Some(&vec![0xFF])); in test_extract_service_data()
286 assert_eq!(service_data.get(&expected_uuid), Some(&vec![0xFE])); in test_extract_service_data()
[all …]
/packages/modules/Virtualization/virtualizationservice/src/
Dmaintenance.rs322 Ok(vec![]) in processSecretManagementRequest()
390 vec![ in test_sk_state_batching()
391 SkOp::DeleteIds(vec![VM_ID1, VM_ID2]), in test_sk_state_batching()
392 SkOp::DeleteIds(vec![VM_ID3, VM_ID4]), in test_sk_state_batching()
393 SkOp::DeleteIds(vec![VM_ID5]), in test_sk_state_batching()
404 assert_eq!(got, vec![SkOp::DeleteIds(vec![VM_ID1, VM_ID2, VM_ID3, VM_ID4, VM_ID5])]); in test_sk_state_no_batching()
417 assert_eq!((*history.lock().unwrap()).clone(), vec![]); in test_sk_state()
420 assert_eq!((*history.lock().unwrap()).clone(), vec![SkOp::DeleteIds(vec![VM_ID3])]); in test_sk_state()
425 vec![SkOp::DeleteIds(vec![VM_ID3]), SkOp::DeleteIds(vec![VM_ID4, VM_ID5]),] in test_sk_state()
428 assert_eq!(vec![VM_ID1, VM_ID2], get_db(&mut sk_state).vm_ids_for_user(USER1).unwrap()); in test_sk_state()
[all …]
/packages/modules/Uwb/service/tests/src/com/android/server/uwb/correction/math/
DAoaVectorTest.java37 AoaVector vec = AoaVector.fromDegrees(90, 90, 1); in testCtorScaleDown() local
38 assertClose(vec.elevation, Math.PI / 4); in testCtorScaleDown()
39 assertClose(vec.azimuth, Math.PI / 4); in testCtorScaleDown()
41 vec = AoaVector.fromDegrees(180 - 45, 90, 1); in testCtorScaleDown()
42 assertClose(vec.azimuth, Math.PI * 5 / 6); in testCtorScaleDown()
43 assertClose(vec.elevation, Math.PI / 3); in testCtorScaleDown()
48 AoaVector vec = AoaVector.fromDegrees(185, 10, 10); in testCtorNormalization() local
49 assertClose(toDegrees(vec.azimuth), -175); in testCtorNormalization()
50 assertClose(toDegrees(vec.elevation), 10); in testCtorNormalization()
54 vec = AoaVector.fromRadians((float) toRadians(5), (float) toRadians(110), 10); in testCtorNormalization()
[all …]
DSphericalVectorTest.java35 SphericalVector vec = SphericalVector.fromDegrees(185, 10, 10); in testCtorNormalization() local
36 assertClose(toDegrees(vec.azimuth), -175); in testCtorNormalization()
37 assertClose(toDegrees(vec.elevation), 10); in testCtorNormalization()
41 vec = SphericalVector.fromRadians((float) toRadians(5), (float) toRadians(110), 10); in testCtorNormalization()
42 assertClose(vec.azimuth, toRadians(-175)); // +5deg from "behind". in testCtorNormalization()
45 assertClose(vec.elevation, toRadians(70)); in testCtorNormalization()
126 SphericalVector vec = SphericalVector.fromDegrees(10, 15, 20); in annotated() local
127 SphericalVector.Annotated sparse = vec.toAnnotated(); in annotated()
129 assertClose(sparse, vec); in annotated()
133 sparse = vec.toAnnotated(true, false, false); in annotated()
[all …]
/packages/modules/Bluetooth/system/rust/src/gatt/server/transactions/
Dread_by_group_type_request.rs116 let db = TestAttDatabase::new(vec![ in test_simple_grouping()
123 vec![4, 5], in test_simple_grouping()
131 vec![5, 6], in test_simple_grouping()
139 vec![6, 7], in test_simple_grouping()
180 let db = TestAttDatabase::new(vec![]); in test_invalid_group_type()
207 let db = TestAttDatabase::new(vec![]); in test_range_validation()
234 let db = TestAttDatabase::new(vec![( in test_attribute_truncation()
240 vec![1, 2, 3, 4, 5], in test_attribute_truncation()
274 let db = TestAttDatabase::new(vec![ in test_limit_total_size()
281 vec![4, 5, 6], in test_limit_total_size()
[all …]
Dread_by_type_request.rs99 let db = TestAttDatabase::new(vec![( in test_single_matching_attr()
105 vec![4, 5], in test_single_matching_attr()
136 let db = TestAttDatabase::new(vec![ in test_type_filtering()
143 vec![4, 5], in test_type_filtering()
151 vec![5, 6], in test_type_filtering()
159 vec![6, 7], in test_type_filtering()
198 let db = TestAttDatabase::new(vec![ in test_limit_total_size()
205 vec![4, 5, 6], in test_limit_total_size()
213 vec![5, 6, 7], in test_limit_total_size()
245 let db = TestAttDatabase::new(vec![ in test_no_results()
[all …]
Dfind_information_request.rs121 let db = TestAttDatabase::new(vec![ in test_long_uuids()
128 vec![4, 5], in test_long_uuids()
136 vec![4, 5], in test_long_uuids()
144 vec![4, 5], in test_long_uuids()
184 let db = TestAttDatabase::new(vec![ in test_short_uuids()
191 vec![4, 5], in test_short_uuids()
199 vec![4, 5], in test_short_uuids()
207 vec![4, 5], in test_short_uuids()
247 let db = TestAttDatabase::new(vec![]); in test_handle_validation()
273 let db = TestAttDatabase::new(vec![ in test_limit_total_size()
[all …]
Dread_request.rs54 TestAttDatabase::new(vec![( in make_db_with_handle_and_value()
77 let db = make_db_with_handle_and_value(3, vec![4, 5]); in test_simple_read()
92 let db = make_db_with_handle_and_value(3, vec![4, 5]); in test_truncated_read()
98 assert_eq!(response.to_vec().unwrap(), vec![4]); in test_truncated_read()
103 let db = make_db_with_handle_and_value(3, vec![4, 5]); in test_missed_read()
120 TestAttDatabase::new(vec![( in make_db_with_unreadable_handle()
126 vec![], in make_db_with_unreadable_handle()
Dwrite_request.rs51 let db = TestAttDatabase::new(vec![( in test_successful_write()
57 vec![], in test_successful_write()
59 let data = vec![1, 2]; in test_successful_write()
78 let db = TestAttDatabase::new(vec![( in test_failed_write()
84 vec![], in test_failed_write()
/packages/modules/Bluetooth/system/rust/src/gatt/server/
Dgatt_database.rs179 let mut characteristics = vec![]; in add_service_with_handles()
561 characteristics: vec![], in test_single_service()
573 vec![AttAttribute { in test_single_service()
601 characteristics: vec![GattCharacteristicWithHandle { in test_service_removal()
605 descriptors: vec![], in test_service_removal()
616 characteristics: vec![GattCharacteristicWithHandle { in test_service_removal()
620 descriptors: vec![], in test_service_removal()
631 characteristics: vec![GattCharacteristicWithHandle { in test_service_removal()
635 descriptors: vec![], in test_service_removal()
679 characteristics: vec![GattCharacteristicWithHandle { in test_single_characteristic_declaration()
[all …]
/packages/modules/StatsD/lib/libstatssocket/
Dstats_buffer_writer.c31 static int __write_to_statsd_init(struct iovec* vec, size_t nr);
32 static int (*__write_to_statsd)(struct iovec* vec, size_t nr) = __write_to_statsd_init;
88 static int __write_to_stats_daemon(struct iovec* vec, size_t nr) { in __write_to_stats_daemon() argument
94 len += vec[i].iov_len; in __write_to_stats_daemon()
110 int ret = (int)(*statsdLoggerWrite.write)(&ts, vec, nr); in __write_to_stats_daemon()
125 static int __write_to_statsd_init(struct iovec* vec, size_t nr) { in __write_to_statsd_init() argument
143 ret = __write_to_statsd(vec, nr); in __write_to_statsd_init()
/packages/modules/UprobeStats/src/
DBpf.cpp80 std::vector<int32_t> vec; in pollRingBuf() local
82 return vec; in pollRingBuf()
84 auto callback = [&](const uint64_t &value) { vec.push_back(value); }; in pollRingBuf()
86 return vec; in pollRingBuf()
91 std::vector<int32_t> vec; in consumeRingBuf() local
92 auto callback = [&](const uint64_t &value) { vec.push_back(value); }; in consumeRingBuf()
94 return vec; in consumeRingBuf()
/packages/modules/Uwb/service/java/com/android/server/uwb/correction/math/
DAoaVector.java205 public static AoaVector fromSphericalVector(SphericalVector vec) { in fromSphericalVector() argument
206 float azimuth = vec.azimuth; in fromSphericalVector()
212 double se = sin(vec.elevation); in fromSphericalVector()
213 double ce = cos(vec.elevation); in fromSphericalVector()
215 * signum(vec.azimuth); in fromSphericalVector()
217 return new AoaVector(F_PI - (float) az, vec.elevation, vec.distance); in fromSphericalVector()
219 return new AoaVector((float) az, vec.elevation, vec.distance); in fromSphericalVector()
DSphericalVector.java155 public static SphericalVector fromAoAVector(AoaVector vec) { in fromAoAVector() argument
156 float azimuth = vec.azimuth; in fromAoAVector()
162 double se = sin(vec.elevation); in fromAoAVector()
163 double azz = sqrt(max(ca * ca - se * se, 0)) / cos(vec.elevation); in fromAoAVector()
164 double az = acos(min(max(azz, -1), 1)) * signum(vec.azimuth); in fromAoAVector()
166 return new SphericalVector(F_PI - (float) az, vec.elevation, vec.distance); in fromAoAVector()
168 return new SphericalVector((float) az, vec.elevation, vec.distance); in fromAoAVector()
/packages/modules/Virtualization/virtualizationservice/src/maintenance/
Dvmdb.rs443 assert_eq!(vec![VM_ID1], db.vm_ids_for_user(USER1).unwrap()); in test_schema_upgrade_v0_v1()
462 assert_eq!(vec![VM_ID1], db.vm_ids_for_user(USER1).unwrap()); in test_corrupt_database_file()
509 vec![(USER1, APP_A), (USER2, APP_B), (USER3, APP_C)], in test_add_remove()
515 assert_eq!(vec![VM_ID1, VM_ID2, VM_ID3], db.vm_ids_for_user(USER1).unwrap()); in test_add_remove()
516 assert_eq!(vec![VM_ID1, VM_ID2, VM_ID3], db.vm_ids_for_app(USER1, APP_A).unwrap()); in test_add_remove()
518 assert_eq!(vec![VM_ID4], db.vm_ids_for_app(USER2, APP_B).unwrap()); in test_add_remove()
520 assert_eq!(vec![VM_ID5], db.vm_ids_for_user(USER3).unwrap()); in test_add_remove()
534 assert_eq!(vec![VM_ID1], db.vm_ids_for_user(USER1).unwrap()); in test_add_remove()
535 assert_eq!(vec![VM_ID1], db.vm_ids_for_app(USER1, APP_A).unwrap()); in test_add_remove()
541 assert_eq!(vec![VM_ID1], db.vm_ids_for_user(USER1).unwrap()); in test_add_remove()
[all …]
/packages/modules/Virtualization/libs/bssl/tests/
Daead_test.rs42 let mut out = vec![0u8; ciphertext.len()]; in aes_256_gcm_encrypts_and_decrypts_successfully()
56 let mut out = vec![0u8; MESSAGE.len() + aead_ctx.aead().max_overhead()]; in aes_256_gcm_fails_to_encrypt_with_invalid_nonce()
75 let mut plaintext = vec![0u8; ciphertext.len()]; in aes_256_gcm_fails_to_decrypt_with_wrong_key()
92 let mut plaintext = vec![0u8; ciphertext.len()]; in aes_256_gcm_fails_to_decrypt_with_different_ad()
109 let mut plaintext = vec![0u8; ciphertext.len()]; in aes_256_gcm_fails_to_decrypt_with_different_nonce()
127 let mut plaintext = vec![0u8; ciphertext.len()]; in aes_256_gcm_fails_to_decrypt_corrupted_ciphertext()
140 let mut out = vec![0u8; message.len() + aead_ctx.aead().max_overhead()]; in aes_256_gcm_encrypt()
/packages/modules/Virtualization/authfs/src/fsverity/
Dbuilder.rs53 ctx.update(&vec![0u8; padding_bytes]); in hash_all_pages()
173 generate_fsverity_digest_sequentially(&vec![1; 4096])? in merkle_tree_file_size_less_than_or_equal_to_4k()
184 generate_fsverity_digest_sequentially(&vec![1; 4097])? in merkle_tree_more_sizes()
189 generate_fsverity_digest_sequentially(&vec![1; 8192])? in merkle_tree_more_sizes()
195 generate_fsverity_digest_sequentially(&vec![1; 524288])? in merkle_tree_more_sizes()
201 generate_fsverity_digest_sequentially(&vec![1; 524289])? in merkle_tree_more_sizes()
209 let hash = sha256(&vec![1u8; CHUNK_SIZE as usize]); in merkle_tree_non_sequential()
264 ctx.update(&vec![0u8; CHUNK_SIZE as usize - chunk.len()]); in generate_fsverity_digest_sequentially()
/packages/modules/Virtualization/pvmfw/src/
Ddevice_assignment.rs25 use alloc::vec;
26 use alloc::vec::Vec;
463 let mut phandles = vec![]; in collect_phandle_references_from_overlayable_nodes()
532 let mut removed = vec![]; in filter_dangling_symbols()
564 let mut stack = vec![mask]; in filter_with_mask()
655 let mut reg_cells = vec![]; in to_be_bytes()
697 let mut iommus = vec![]; in parse_iommus()
800 let mut iommus = vec![]; in parse_iommus()
983 let mut assigned_devices = vec![]; in internal_parse()
984 let mut assigned_device_paths = vec![]; in internal_parse()
[all …]

12345678