@@ -941,12 +941,21 @@ mod tests {
941
941
use crate :: chatlist:: Chatlist ;
942
942
use crate :: constants:: Chattype ;
943
943
use crate :: peerstate:: Peerstate ;
944
- use crate :: test_utils:: TestContext ;
944
+ use crate :: test_utils:: { LogSink , TestContext } ;
945
945
946
946
#[ async_std:: test]
947
947
async fn test_setup_contact ( ) -> Result < ( ) > {
948
- let alice = TestContext :: new_alice ( ) . await ;
949
- let bob = TestContext :: new_bob ( ) . await ;
948
+ let ( log_tx, _log_sink) = LogSink :: create ( ) ;
949
+ let alice = TestContext :: builder ( )
950
+ . as_alice ( )
951
+ . with_log_sink ( log_tx. clone ( ) )
952
+ . build ( )
953
+ . await ;
954
+ let bob = TestContext :: builder ( )
955
+ . as_bob ( )
956
+ . with_log_sink ( log_tx)
957
+ . build ( )
958
+ . await ;
950
959
assert_eq ! ( Chatlist :: try_load( & alice, 0 , None , None ) . await ?. len( ) , 0 ) ;
951
960
assert_eq ! ( Chatlist :: try_load( & bob, 0 , None , None ) . await ?. len( ) , 0 ) ;
952
961
@@ -1133,8 +1142,17 @@ mod tests {
1133
1142
1134
1143
#[ async_std:: test]
1135
1144
async fn test_setup_contact_bob_knows_alice ( ) -> Result < ( ) > {
1136
- let alice = TestContext :: new_alice ( ) . await ;
1137
- let bob = TestContext :: new_bob ( ) . await ;
1145
+ let ( log_tx, _log_sink) = LogSink :: create ( ) ;
1146
+ let alice = TestContext :: builder ( )
1147
+ . as_alice ( )
1148
+ . with_log_sink ( log_tx. clone ( ) )
1149
+ . build ( )
1150
+ . await ;
1151
+ let bob = TestContext :: builder ( )
1152
+ . as_bob ( )
1153
+ . with_log_sink ( log_tx)
1154
+ . build ( )
1155
+ . await ;
1138
1156
1139
1157
// Ensure Bob knows Alice_FP
1140
1158
let alice_pubkey = SignedPublicKey :: load_self ( & alice. ctx ) . await ?;
@@ -1257,8 +1275,17 @@ mod tests {
1257
1275
1258
1276
#[ async_std:: test]
1259
1277
async fn test_setup_contact_concurrent_calls ( ) -> Result < ( ) > {
1260
- let alice = TestContext :: new_alice ( ) . await ;
1261
- let bob = TestContext :: new_bob ( ) . await ;
1278
+ let ( log_tx, _log_sink) = LogSink :: create ( ) ;
1279
+ let alice = TestContext :: builder ( )
1280
+ . as_alice ( )
1281
+ . with_log_sink ( log_tx. clone ( ) )
1282
+ . build ( )
1283
+ . await ;
1284
+ let bob = TestContext :: builder ( )
1285
+ . as_bob ( )
1286
+ . with_log_sink ( log_tx)
1287
+ . build ( )
1288
+ . await ;
1262
1289
1263
1290
// do a scan that is not working as claire is never responding
1264
1291
let qr_stale = "OPENPGP4FPR:1234567890123456789012345678901234567890#a=claire%40foo.de&n=&i=12345678901&s=23456789012" ;
@@ -1287,8 +1314,17 @@ mod tests {
1287
1314
1288
1315
#[ async_std:: test]
1289
1316
async fn test_secure_join ( ) -> Result < ( ) > {
1290
- let alice = TestContext :: new_alice ( ) . await ;
1291
- let bob = TestContext :: new_bob ( ) . await ;
1317
+ let ( log_tx, _log_sink) = LogSink :: create ( ) ;
1318
+ let alice = TestContext :: builder ( )
1319
+ . as_alice ( )
1320
+ . with_log_sink ( log_tx. clone ( ) )
1321
+ . build ( )
1322
+ . await ;
1323
+ let bob = TestContext :: builder ( )
1324
+ . as_bob ( )
1325
+ . with_log_sink ( log_tx)
1326
+ . build ( )
1327
+ . await ;
1292
1328
assert_eq ! ( Chatlist :: try_load( & alice, 0 , None , None ) . await ?. len( ) , 0 ) ;
1293
1329
assert_eq ! ( Chatlist :: try_load( & bob, 0 , None , None ) . await ?. len( ) , 0 ) ;
1294
1330
0 commit comments