diff --git a/kuksa_databroker/databroker/tests/read_write_values.rs b/kuksa_databroker/databroker/tests/read_write_values.rs index d1c4c013..a0377b7f 100644 --- a/kuksa_databroker/databroker/tests/read_write_values.rs +++ b/kuksa_databroker/databroker/tests/read_write_values.rs @@ -252,9 +252,9 @@ fn assert_current_value_unauthenticated(w: &mut DataBrokerWorld) { if let Some(error) = w.current_client_error.clone() { match error { ClientError::Connection(e) => { - assert!(false, "No connection error {:?} should occcur", e) + panic!("No connection error {:?} should occcur", e) } - ClientError::Function(e) => assert!(false, "No function error {:?} should occur", e), + ClientError::Function(e) => panic!("No function error {:?} should occur", e), ClientError::Status(status) => assert_eq!(status.code(), Code::Unauthenticated), } } diff --git a/kuksa_databroker/databroker/tests/world/mod.rs b/kuksa_databroker/databroker/tests/world/mod.rs index 56215992..201cb015 100644 --- a/kuksa_databroker/databroker/tests/world/mod.rs +++ b/kuksa_databroker/databroker/tests/world/mod.rs @@ -294,14 +294,14 @@ impl DataBrokerWorld { /// https://github.com/grpc/grpc/blob/master/doc/statuscodes.md#status-codes-and-their-use-in-grpc pub fn assert_status_has_code(&self, expected_status_code: i32) { match &self.current_client_error { - Some(ClientError::Connection(_)) => assert!(false, "Connection error shall not occur"), + Some(ClientError::Connection(_)) => panic!("Connection error shall not occur"), Some(ClientError::Function(_)) => { - assert!(false, "Fucntion has an error that shall not occur") + panic!("Fucntion has an error that shall not occur") } Some(ClientError::Status(status)) => { assert_eq!(status.code(), Code::from_i32(expected_status_code)) } - None => assert!(false, "No error, but an errror is expected"), + None => panic!("No error, but an errror is expected"), } } @@ -310,7 +310,7 @@ impl DataBrokerWorld { if let Some(client_error) = self.current_client_error.clone() { match client_error { - ClientError::Connection(_) => assert!(false, "response contains connection error"), + ClientError::Connection(_) => panic!("response contains connection error"), ClientError::Function(e) => { for element in e { if !code.contains(&element.code) { @@ -318,7 +318,7 @@ impl DataBrokerWorld { } } } - ClientError::Status(_) => assert!(false, "response contains channel error"), + ClientError::Status(_) => panic!("response contains channel error"), } assert!( @@ -328,7 +328,7 @@ impl DataBrokerWorld { ); assert_eq!(code, error_codes, "response contains unexpected error code"); } else { - assert!(false, "response contains no error code"); + panic!("response contains no error code"); } } @@ -336,17 +336,15 @@ impl DataBrokerWorld { if let Some(error) = self.current_client_error.clone() { match error { ClientError::Connection(e) => { - assert!(false, "No connection error {:?} should occcur", e) + panic!("No connection error {:?} should occcur", e) } ClientError::Function(e) => { - assert!(false, "No function error {:?} should occur", e) + panic!("No function error {:?} should occur", e) } ClientError::Status(status) => { - assert!(false, "No status error {:?} should occur", status) + panic!("No status error {:?} should occur", status) } } - } else { - assert!(true, "Succeeded") } } }