From c4db7654230410871d7f1ccbabc210e2280456bc Mon Sep 17 00:00:00 2001 From: John Smith Date: Sat, 22 Jul 2023 14:41:14 -0400 Subject: [PATCH] fixes for test --- Cargo.lock | 1 - veilid-tools/src/assembly_buffer.rs | 2 +- veilid-tools/src/tests/native/test_assembly_buffer.rs | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 26666032..402ee9c9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5896,7 +5896,6 @@ dependencies = [ "oslog", "paranoid-android", "parking_lot 0.11.2", - "parking_lot 0.12.1", "rand 0.7.3", "range-set-blaze", "rust-fsm", diff --git a/veilid-tools/src/assembly_buffer.rs b/veilid-tools/src/assembly_buffer.rs index d2bdf077..44ed3d58 100644 --- a/veilid-tools/src/assembly_buffer.rs +++ b/veilid-tools/src/assembly_buffer.rs @@ -12,7 +12,7 @@ const MAX_LEN: usize = LengthType::MAX as usize; // XXX: keep statistics on all drops and why we dropped them // XXX: move to config eventually? -const FRAGMENT_LEN: usize = 1280 - HEADER_LEN; +pub const FRAGMENT_LEN: usize = 1280 - HEADER_LEN; const MAX_CONCURRENT_HOSTS: usize = 256; const MAX_ASSEMBLIES_PER_HOST: usize = 256; const MAX_BUFFER_PER_HOST: usize = 256 * 1024; diff --git a/veilid-tools/src/tests/native/test_assembly_buffer.rs b/veilid-tools/src/tests/native/test_assembly_buffer.rs index 73268516..95620ad8 100644 --- a/veilid-tools/src/tests/native/test_assembly_buffer.rs +++ b/veilid-tools/src/tests/native/test_assembly_buffer.rs @@ -86,7 +86,7 @@ pub async fn test_one_frag_out_in() { // Sending println!("sending"); for _ in 0..10000 { - let random_len = (get_random_u32() % 1000) as usize + 1280; + let random_len = (get_random_u32() % 1000) as usize + FRAGMENT_LEN; let mut message = vec![1u8; random_len]; random_bytes(&mut message); let remote_addr = random_sockaddr(); @@ -289,7 +289,7 @@ pub async fn test_many_frags_with_drops() { println!("sending"); for _ in 0..1000 { let random_len = (get_random_u32() % 65536) as usize; - if random_len > 1280 { + if random_len > FRAGMENT_LEN { total_fragged += 1; } total_sent_size += random_len;