refactor(client): remove redundant timestamp parameter from close method
This commit is contained in:
1 parent
023e85741a
commit
d8b580a19c
13 files changed
+69
-102
No files matched your search
@@ -101,7 +101,7 @@ fn hmac_close_success_sends_authenticated_close_and_closes_session() {
|
||||
let outcome = client.open().unwrap();
|
||||
assert_started(outcome, ¶ms);
|
||||
|
||||
let events = client.close(ClientTimestamp::now()).unwrap();
|
||||
let events = client.close().unwrap();
|
||||
assert!(matches!(
|
||||
events.as_slice(),
|
||||
[ClientEvent::SessionClosed { token: TOKEN, .. }]
|
||||
@@ -131,10 +131,7 @@ fn missing_client_key_against_hmac_required_server_times_out() {
|
||||
config.hmac_key = None;
|
||||
|
||||
let mut client = Client::connect(config).unwrap();
|
||||
assert!(matches!(
|
||||
client.open(),
|
||||
Err(ClientError::OpenTimeout)
|
||||
));
|
||||
assert!(matches!(client.open(), Err(ClientError::OpenTimeout)));
|
||||
|
||||
let observations = server.observations(1);
|
||||
assert!(matches!(
|
||||
@@ -156,10 +153,7 @@ fn wrong_client_key_against_hmac_required_server_times_out() {
|
||||
config.hmac_key = Some(b"wrong-secret".to_vec());
|
||||
|
||||
let mut client = Client::connect(config).unwrap();
|
||||
assert!(matches!(
|
||||
client.open(),
|
||||
Err(ClientError::OpenTimeout)
|
||||
));
|
||||
assert!(matches!(client.open(), Err(ClientError::OpenTimeout)));
|
||||
|
||||
let observations = server.observations(1);
|
||||
assert!(matches!(
|
||||
@@ -314,7 +308,7 @@ fn backend_hmac_correct_key_succeeds() {
|
||||
assert_eq!(events.len(), 1);
|
||||
assert!(matches!(events[0], ClientEvent::EchoReply { .. }));
|
||||
|
||||
client.close(ClientTimestamp::now()).unwrap();
|
||||
client.close().unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -326,10 +320,7 @@ fn backend_hmac_wrong_key_fails() {
|
||||
config.hmac_key = Some(b"wrong-secret".to_vec());
|
||||
|
||||
let mut client = Client::connect(config).unwrap();
|
||||
assert!(matches!(
|
||||
client.open(),
|
||||
Err(ClientError::OpenTimeout)
|
||||
));
|
||||
assert!(matches!(client.open(), Err(ClientError::OpenTimeout)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -341,8 +332,5 @@ fn backend_hmac_missing_key_fails() {
|
||||
config.hmac_key = None;
|
||||
|
||||
let mut client = Client::connect(config).unwrap();
|
||||
assert!(matches!(
|
||||
client.open(),
|
||||
Err(ClientError::OpenTimeout)
|
||||
));
|
||||
assert!(matches!(client.open(), Err(ClientError::OpenTimeout)));
|
||||
}
|
||||
@@ -136,5 +136,5 @@ fn backend_large_packet_smoke() {
|
||||
assert_eq!(events.len(), 1);
|
||||
assert!(matches!(events[0], ClientEvent::EchoReply { .. }));
|
||||
|
||||
client.close(ClientTimestamp::now()).unwrap();
|
||||
client.close().unwrap();
|
||||
}
|
||||
@@ -389,7 +389,7 @@ fn backend_basic_open_echo_close() {
|
||||
assert_eq!(events.len(), 1);
|
||||
assert!(matches!(events[0], ClientEvent::EchoReply { .. }));
|
||||
|
||||
client.close(ClientTimestamp::now()).unwrap();
|
||||
client.close().unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -410,7 +410,7 @@ fn backend_ttl_smoke() {
|
||||
assert_eq!(events.len(), 1);
|
||||
assert!(matches!(events[0], ClientEvent::EchoReply { .. }));
|
||||
|
||||
client.close(ClientTimestamp::now()).unwrap();
|
||||
client.close().unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -422,7 +422,7 @@ fn dscp_configured_open_close_smoke() {
|
||||
|
||||
let outcome = client.open().unwrap();
|
||||
assert!(matches!(outcome, irtt_client::OpenOutcome::Started { .. }));
|
||||
client.close(ClientTimestamp::now()).unwrap();
|
||||
client.close().unwrap();
|
||||
server.join();
|
||||
}
|
||||
|
||||
@@ -444,7 +444,7 @@ fn backend_received_stats_smoke() {
|
||||
assert_eq!(events.len(), 1);
|
||||
assert!(matches!(events[0], ClientEvent::EchoReply { .. }));
|
||||
|
||||
client.close(ClientTimestamp::now()).unwrap();
|
||||
client.close().unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -497,7 +497,7 @@ fn backend_timestamp_smoke() {
|
||||
other => panic!("expected EchoReply, got {other:?}"),
|
||||
}
|
||||
|
||||
client.close(ClientTimestamp::now()).unwrap();
|
||||
client.close().unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -536,6 +536,6 @@ fn backend_clock_smoke() {
|
||||
other => panic!("expected EchoReply, got {other:?}"),
|
||||
}
|
||||
|
||||
client.close(ClientTimestamp::now()).unwrap();
|
||||
client.close().unwrap();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user