Lines Matching refs:a
13 let a = Allocation::new( in test_has_permission() localVariable
30 a.add_permission(p1).await; in test_has_permission()
31 a.add_permission(p2).await; in test_has_permission()
32 a.add_permission(p3).await; in test_has_permission()
34 let found_p1 = a.has_permission(&addr1).await; in test_has_permission()
37 let found_p2 = a.has_permission(&addr2).await; in test_has_permission()
40 let found_p3 = a.has_permission(&addr3).await; in test_has_permission()
51 let a = Allocation::new( in test_add_permission() localVariable
62 a.add_permission(p).await; in test_add_permission()
64 let found_p = a.has_permission(&addr).await; in test_add_permission()
75 let a = Allocation::new( in test_remove_permission() localVariable
87 a.add_permission(p).await; in test_remove_permission()
89 let found_p = a.has_permission(&addr).await; in test_remove_permission()
92 a.remove_permission(&addr).await; in test_remove_permission()
94 let found_permission = a.has_permission(&addr).await; in test_remove_permission()
108 let a = Allocation::new( in test_add_channel_bind() localVariable
120 a.add_channel_bind(c, DEFAULT_LIFETIME).await?; in test_add_channel_bind()
123 let result = a.add_channel_bind(c2, DEFAULT_LIFETIME).await; in test_add_channel_bind()
131 let result = a.add_channel_bind(c3, DEFAULT_LIFETIME).await; in test_add_channel_bind()
142 let a = Allocation::new( in test_get_channel_by_number() localVariable
154 a.add_channel_bind(c, DEFAULT_LIFETIME).await?; in test_get_channel_by_number()
156 let exist_channel_addr = a in test_get_channel_by_number()
162 let not_exist_channel = a in test_get_channel_by_number()
178 let a = Allocation::new( in test_get_channel_by_addr() localVariable
191 a.add_channel_bind(c, DEFAULT_LIFETIME).await?; in test_get_channel_by_addr()
193 let exist_channel_number = a.get_channel_number(&addr).await.unwrap(); in test_get_channel_by_addr()
196 let not_exist_channel = a.get_channel_number(&addr2).await; in test_get_channel_by_addr()
210 let a = Allocation::new( in test_remove_channel_bind() localVariable
223 a.add_channel_bind(c, DEFAULT_LIFETIME).await?; in test_remove_channel_bind()
225 a.remove_channel_bind(number).await; in test_remove_channel_bind()
227 let not_exist_channel = a.get_channel_addr(&number).await; in test_remove_channel_bind()
233 let not_exist_channel = a.get_channel_number(&addr).await; in test_remove_channel_bind()
247 let a = Allocation::new( in test_allocation_refresh() localVariable
256 a.start(DEFAULT_LIFETIME).await; in test_allocation_refresh()
257 a.refresh(Duration::from_secs(0)).await; in test_allocation_refresh()
259 assert!(!a.stop(), "lifetimeTimer has expired"); in test_allocation_refresh()
269 let a = Allocation::new( in test_allocation_close() localVariable
279 a.start(DEFAULT_LIFETIME).await; in test_allocation_close()
286 a.add_channel_bind(c, DEFAULT_LIFETIME).await?; in test_allocation_close()
289 a.add_permission(Permission::new(addr)).await; in test_allocation_close()
291 a.close().await?; in test_allocation_close()