ffi work
This commit is contained in:
@@ -19,10 +19,9 @@ fn setup_veilid_core() -> VeilidCoreSetup {
|
||||
}
|
||||
}
|
||||
|
||||
async fn startup(core: VeilidCore) -> VeilidAPI {
|
||||
async fn startup() -> VeilidAPI {
|
||||
trace!("test_table_store: starting");
|
||||
let api = core
|
||||
.startup(setup_veilid_core())
|
||||
let api = api_startup(setup_veilid_core())
|
||||
.await
|
||||
.expect("startup failed");
|
||||
api
|
||||
@@ -130,9 +129,8 @@ pub async fn test_dh(crypto: Crypto) {
|
||||
}
|
||||
|
||||
pub async fn test_all() {
|
||||
let core = VeilidCore::new();
|
||||
let api = startup(core.clone()).await;
|
||||
let crypto = core.crypto();
|
||||
let api = startup().await;
|
||||
let crypto = api.crypto().unwrap();
|
||||
test_enc_dec().await;
|
||||
test_dh(crypto).await;
|
||||
shutdown(api.clone()).await;
|
||||
|
@@ -8,13 +8,12 @@ use crate::*;
|
||||
|
||||
pub async fn test_envelope_round_trip() {
|
||||
info!("--- test envelope round trip ---");
|
||||
let veilid_core = VeilidCore::new();
|
||||
let api = veilid_core
|
||||
.startup(setup_veilid_core())
|
||||
let api = api_startup(setup_veilid_core())
|
||||
.await
|
||||
.expect("startup failed");
|
||||
|
||||
// Get crypto
|
||||
let crypto = veilid_core.crypto();
|
||||
let crypto = api.crypto().unwrap();
|
||||
|
||||
// Create envelope
|
||||
let ts = 0x12345678ABCDEF69u64;
|
||||
|
@@ -16,9 +16,9 @@ fn setup_veilid_core() -> VeilidCoreSetup {
|
||||
}
|
||||
}
|
||||
|
||||
async fn startup(core: VeilidCore) -> VeilidAPI {
|
||||
async fn startup() -> VeilidAPI {
|
||||
trace!("test_table_store: starting");
|
||||
core.startup(setup_veilid_core())
|
||||
api_startup(setup_veilid_core())
|
||||
.await
|
||||
.expect("startup failed")
|
||||
}
|
||||
@@ -93,10 +93,8 @@ pub async fn test_protected_store(ps: ProtectedStore) {
|
||||
}
|
||||
|
||||
pub async fn test_all() {
|
||||
let core = VeilidCore::new();
|
||||
let api = startup(core.clone()).await;
|
||||
|
||||
let ps = core.protected_store();
|
||||
let api = startup().await;
|
||||
let ps = api.protected_store().unwrap();
|
||||
test_protected_store(ps.clone()).await;
|
||||
|
||||
shutdown(api).await;
|
||||
|
@@ -17,9 +17,9 @@ fn setup_veilid_core() -> VeilidCoreSetup {
|
||||
}
|
||||
}
|
||||
|
||||
async fn startup(core: VeilidCore) -> VeilidAPI {
|
||||
async fn startup() -> VeilidAPI {
|
||||
trace!("test_table_store: starting");
|
||||
core.startup(setup_veilid_core())
|
||||
api_startup(setup_veilid_core())
|
||||
.await
|
||||
.expect("startup failed")
|
||||
}
|
||||
@@ -169,10 +169,8 @@ pub async fn test_cbor(ts: TableStore) {
|
||||
}
|
||||
|
||||
pub async fn test_all() {
|
||||
let core = VeilidCore::new();
|
||||
let api = startup(core.clone()).await;
|
||||
|
||||
let ts = core.table_store();
|
||||
let api = startup().await;
|
||||
let ts = api.table_store().unwrap();
|
||||
test_delete_open_delete(ts.clone()).await;
|
||||
test_store_delete_load(ts.clone()).await;
|
||||
test_cbor(ts.clone()).await;
|
||||
|
@@ -4,9 +4,7 @@ use crate::*;
|
||||
|
||||
pub async fn test_startup_shutdown() {
|
||||
trace!("test_startup_shutdown: starting");
|
||||
let veilid_core = VeilidCore::new();
|
||||
let api = veilid_core
|
||||
.startup(setup_veilid_core())
|
||||
let api = api_startup(setup_veilid_core())
|
||||
.await
|
||||
.expect("startup failed");
|
||||
trace!("test_startup_shutdown: shutting down");
|
||||
@@ -15,11 +13,8 @@ pub async fn test_startup_shutdown() {
|
||||
}
|
||||
|
||||
pub async fn test_attach_detach() {
|
||||
let veilid_core = VeilidCore::new();
|
||||
|
||||
info!("--- test normal order ---");
|
||||
let api = veilid_core
|
||||
.startup(setup_veilid_core())
|
||||
let api = api_startup(setup_veilid_core())
|
||||
.await
|
||||
.expect("startup failed");
|
||||
api.attach().await.unwrap();
|
||||
@@ -31,8 +26,7 @@ pub async fn test_attach_detach() {
|
||||
api.shutdown().await;
|
||||
|
||||
info!("--- test auto detach ---");
|
||||
let api = veilid_core
|
||||
.startup(setup_veilid_core())
|
||||
let api = api_startup(setup_veilid_core())
|
||||
.await
|
||||
.expect("startup failed");
|
||||
api.attach().await.unwrap();
|
||||
@@ -40,8 +34,7 @@ pub async fn test_attach_detach() {
|
||||
api.shutdown().await;
|
||||
|
||||
info!("--- test detach without attach ---");
|
||||
let api = veilid_core
|
||||
.startup(setup_veilid_core())
|
||||
let api = api_startup(setup_veilid_core())
|
||||
.await
|
||||
.expect("startup failed");
|
||||
api.detach().await.unwrap();
|
||||
|
Reference in New Issue
Block a user