Merge pull request #584 from betrusted-io/fix-test

fix broken factory test
This commit is contained in:
bunnie 2024-09-24 00:15:30 +08:00 committed by GitHub
commit 5fb60a4958
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,11 +5,11 @@ use std::sync::Arc;
#[cfg(feature = "extra-tests")]
use std::time::Instant;
use String;
use base64::encode;
use codec::*;
use num_traits::*;
use xous::{Message, MessageEnvelope};
use String;
use crate::oqc_test::OqcOp;
use crate::{CommonEnv, ShellCmdApi};
@ -174,8 +174,8 @@ impl<'a> ShellCmdApi<'a> for Test {
"frob" => {
const N: u32 = 10;
const M: usize = if cfg!(miri) { 10000 } else { 100000 };
use std::sync::mpsc::channel;
use std::sync::RwLock;
use std::sync::mpsc::channel;
use std::thread;
use rand::Rng;
@ -372,9 +372,9 @@ impl<'a> ShellCmdApi<'a> for Test {
}
const ROUNDS: usize = 16; // pump a bunch of data to trigger another trng buffer refill, resetting the stats
for _ in 0..ROUNDS {
let mut buf: [u32; 1024] = [0; 1024];
let mut buf: [u32; 1020] = [0; 1020];
env.trng.fill_buf(&mut buf).unwrap();
log::debug!("pump samples: {:x}, {:x}, {:x}", buf[0], buf[512], buf[1023]); // prevent the pump values from being optimized out
log::debug!("pump samples: {:x}, {:x}, {:x}", buf[0], buf[512], buf[1019]); // prevent the pump values from being optimized out
}
ht = env.trng.get_health_tests().unwrap();
}