This commit is contained in:
John Smith
2021-11-27 12:44:21 -05:00
parent d1f728954c
commit 028e02f942
31 changed files with 190 additions and 207 deletions

View File

@@ -136,5 +136,5 @@ pub async fn test_all() {
test_enc_dec().await;
test_dh(crypto).await;
shutdown(api.clone()).await;
assert_eq!(api.is_shutdown(), true);
assert!(api.is_shutdown());
}

View File

@@ -1,3 +1,5 @@
#![allow(clippy::bool_assert_comparison)]
use crate::dht::key;
use crate::xx::*;
use core::convert::TryFrom;
@@ -104,9 +106,9 @@ pub async fn test_key_conversions() {
// Test default key
let (dht_key, dht_key_secret) = (key::DHTKey::default(), key::DHTKeySecret::default());
assert_eq!(dht_key.bytes, EMPTY_KEY);
assert_eq!(dht_key.valid, false);
assert!(!dht_key.valid);
assert_eq!(dht_key_secret.bytes, EMPTY_KEY_SECRET);
assert_eq!(dht_key_secret.valid, false);
assert!(!dht_key_secret.valid);
let dht_key_string = String::from(&dht_key);
trace!("dht_key_string: {:?}", dht_key_string);
let dht_key_string2 = String::from(&dht_key);

View File

@@ -152,8 +152,7 @@ pub async fn test_cbor(ts: TableStore) {
let d = match db.load_cbor::<key::DHTKey>(0, b"asdf").await {
Ok(x) => x,
Err(e) => {
assert!(false, "couldn't decode cbor: {}", e);
return;
panic!("couldn't decode cbor: {}", e);
}
};
assert_eq!(d, Some(dht_key), "keys should be equal");

View File

@@ -1,3 +1,5 @@
#![allow(clippy::bool_assert_comparison)]
use crate::xx::*;
use crate::*;
cfg_if! {
@@ -227,7 +229,7 @@ pub async fn test_config() {
Ok(()) => (),
Err(e) => {
error!("Error: {}", e);
assert!(false);
unreachable!();
}
}
let inner = vc.get();