()
| 154 | |
| 155 | #[tokio::test] |
| 156 | async fn test_client_ping() { |
| 157 | let server = ButtplugServerBuilder::default() |
| 158 | .max_ping_time(200) |
| 159 | .finish() |
| 160 | .expect("Test, assuming infallible."); |
| 161 | let connector = ButtplugInProcessClientConnectorBuilder::default() |
| 162 | .server(server) |
| 163 | .finish(); |
| 164 | let client = ButtplugClient::new("Test Client"); |
| 165 | client |
| 166 | .connect(connector) |
| 167 | .await |
| 168 | .expect("Test, assuming infallible."); |
| 169 | assert!(client.ping().await.is_ok()); |
| 170 | sleep(Duration::from_millis(800)).await; |
| 171 | assert!(client.ping().await.is_err()); |
| 172 | } |
| 173 | |
| 174 | // Tests both the stop-all-devices functionality and the low/high ends of the |
| 175 | // client command range conversion. |
nothing calls this directly
no test coverage detected