diff --git a/databroker/src/grpc/kuksa_val_v2/val.rs b/databroker/src/grpc/kuksa_val_v2/val.rs index c4d730d3..06b574db 100644 --- a/databroker/src/grpc/kuksa_val_v2/val.rs +++ b/databroker/src/grpc/kuksa_val_v2/val.rs @@ -1785,7 +1785,6 @@ mod tests { async fn test_publish_value() { let broker = DataBroker::default(); let authorized_access = broker.authorized_access(&permissions::ALLOW_ALL); - let f = false; let entry_id = authorized_access .add_entry( @@ -1832,7 +1831,7 @@ mod tests { } Err(status) => { // Handle the error from the publish_value function - assert!(f, "Publish failed with status: {:?}", status); + panic!("Publish failed with status: {:?}", status); } } } @@ -1841,7 +1840,6 @@ mod tests { async fn test_publish_value_signal_id_not_found() { let broker = DataBroker::default(); let authorized_access = broker.authorized_access(&permissions::ALLOW_ALL); - let f = false; let _entry_id = authorized_access .add_entry( @@ -1883,7 +1881,7 @@ mod tests { match broker.publish_value(publish_value_request).await { Ok(_) => { // Handle the successful response - assert!(f, "Should not happen!"); + panic!("Should not happen!"); } Err(status) => { // Handle the error from the publish_value function @@ -1965,7 +1963,6 @@ mod tests { }, ); - let f = false; match item { Ok(subscribe_response) => { // Process the SubscribeResponse @@ -1981,24 +1978,21 @@ mod tests { assert_eq!(entry1.value, entry2.value); } (Some(entry1), None) => { - assert!(f, "Key '{}' is only in response: {:?}", key, entry1) + panic!("Key '{}' is only in response: {:?}", key, entry1) + } + (None, Some(entry2)) => { + panic!("Key '{}' is only in expected_response: {:?}", key, entry2) } - (None, Some(entry2)) => assert!( - f, - "Key '{}' is only in expected_response: {:?}", - key, entry2 - ), (None, None) => unreachable!(), } } } Err(err) => { - assert!(f, "Error {:?}", err) + panic!("Error {:?}", err) } } } - let f = false; let broker = DataBroker::default(); let authorized_access = broker.authorized_access(&permissions::ALLOW_ALL); @@ -2077,8 +2071,7 @@ mod tests { // And we do not expect more break; } - _ => assert!( - f, + _ => panic!( "You shouldn't land here too many items reported back to the stream." ), } @@ -2087,7 +2080,7 @@ mod tests { // Make sure stream is not closed in advance assert_eq!(item_count, 4); } else { - assert!(f, "Something went wrong while getting the stream.") + panic!("Something went wrong while getting the stream.") } } @@ -2119,7 +2112,6 @@ mod tests { }, ); - let f = false; match item { Ok(subscribe_response) => { // Process the SubscribeResponse @@ -2131,23 +2123,20 @@ mod tests { assert_eq!(entry1.value, entry2.value); } (Some(entry1), None) => { - assert!(f, "Key '{}' is only in response: {:?}", key, entry1) + panic!("Key '{}' is only in response: {:?}", key, entry1) + } + (None, Some(entry2)) => { + panic!("Key '{}' is only in expected_response: {:?}", key, entry2) } - (None, Some(entry2)) => assert!( - f, - "Key '{}' is only in expected_response: {:?}", - key, entry2 - ), (None, None) => unreachable!(), } } } Err(err) => { - assert!(f, "Error {:?}", err) + panic!("Error {:?}", err) } } } - let f = false; let broker = DataBroker::default(); let authorized_access = broker.authorized_access(&permissions::ALLOW_ALL); @@ -2231,8 +2220,7 @@ mod tests { // And we do not expect more break; } - _ => assert!( - f, + _ => panic!( "You shouldn't land here too many items reported back to the stream." ), } @@ -2241,7 +2229,7 @@ mod tests { // Make sure stream is not closed in advance assert_eq!(item_count, 4); } else { - assert!(f, "Something went wrong while getting the stream.") + panic!("Something went wrong while getting the stream.") } }