diff options
| author | Markus Pettersson <markus.pettersson@mullvad.net> | 2024-04-09 13:14:49 +0200 |
|---|---|---|
| committer | Markus Pettersson <markus.pettersson@mullvad.net> | 2024-04-12 15:01:18 +0200 |
| commit | 39cac2951a0a63814541cade4f0f80b33bbbd18d (patch) | |
| tree | 5d83a31ece1d56e9e6623714c2a470d6c72bfa6a /test/test-manager/src/tests | |
| parent | 94c3ce99aebd53f8c740fe093d03f06f483ea692 (diff) | |
| download | mullvadvpn-39cac2951a0a63814541cade4f0f80b33bbbd18d.tar.xz mullvadvpn-39cac2951a0a63814541cade4f0f80b33bbbd18d.zip | |
Get rid of type casting for test function argument
Replace the `Box<dyn Any>` type for the third test function argument
'mullvad client' - replace it with a dedicated enum type
`MullvadClientArgument`. This change got rid of the type casting from
`Box<dyn Any>` to `MullvadProxyClient` done in the `test_function` macro.
Diffstat (limited to 'test/test-manager/src/tests')
| -rw-r--r-- | test/test-manager/src/tests/mod.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/test/test-manager/src/tests/mod.rs b/test/test-manager/src/tests/mod.rs index f4c4563bde..b89b4f0fd0 100644 --- a/test/test-manager/src/tests/mod.rs +++ b/test/test-manager/src/tests/mod.rs @@ -13,7 +13,7 @@ mod tunnel; mod tunnel_state; mod ui; -use crate::mullvad_daemon::RpcClientProvider; +use crate::mullvad_daemon::{MullvadClientArgument, RpcClientProvider}; use anyhow::Context; pub use test_metadata::TestMetadata; use test_rpc::ServiceClient; @@ -30,11 +30,8 @@ pub struct TestContext { pub rpc_provider: RpcClientProvider, } -pub type TestWrapperFunction = fn( - TestContext, - ServiceClient, - Box<dyn std::any::Any + Send>, -) -> BoxFuture<'static, anyhow::Result<()>>; +pub type TestWrapperFunction = + fn(TestContext, ServiceClient, MullvadClientArgument) -> BoxFuture<'static, anyhow::Result<()>>; #[derive(thiserror::Error, Debug)] pub enum Error { |
