Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sosthene-nitrokey committed Feb 13, 2023
1 parent e34f9af commit c65ae6e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
20 changes: 7 additions & 13 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,23 +175,17 @@ macro_rules! setup {
let pc_interface: UserInterface = Default::default();

let platform = $platform::new(rng, store, pc_interface);
let mut trussed: crate::Service<$platform> = crate::service::Service::new(platform);

let (test_trussed_requester, test_trussed_responder) = crate::pipe::TRUSSED_INTERCHANGE
.claim()
.expect("could not setup TEST TrussedInterchange");
let pipe = interchange::Interchange::new();
let test_client_id = "TEST";

assert!(trussed
.add_endpoint(test_trussed_responder, test_client_id, &[])
.is_ok());
let mut trussed: crate::Service<$platform, 1> =
crate::service::Service::new(platform, &pipe);

trussed.set_seed_if_uninitialized(&$seed);
let mut $client = {
pub type TestClient<'a> =
crate::ClientImplementation<&'a mut crate::Service<$platform>>;
TestClient::new(test_trussed_requester, &mut trussed)
};
let mut $client = crate::client::ClientBuilder::new(test_client_id)
.prepare(&mut trussed)
.expect("Preparing the client should not fail")
.build(&mut trussed);
};
}

Expand Down
2 changes: 1 addition & 1 deletion tests/backends.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use trussed::{
};

type Platform = virt::Platform<Ram>;
type Client = ClientImplementation<Service<Platform, Dispatch>, Dispatch>;
type Client<'pipe> = ClientImplementation<'pipe, Service<'pipe, Platform, 1, Dispatch>, Dispatch>;

const BACKENDS_TEST: &[BackendId<Backend>] = &[BackendId::Custom(Backend::Test), BackendId::Core];

Expand Down

0 comments on commit c65ae6e

Please sign in to comment.