forgot to push..
Some checks failed
Rust/sat-rs/pipeline/pr-main There was a failure building this commit

This commit is contained in:
Robin Müller 2024-02-02 22:57:05 +01:00
parent e0fa0ca7f7
commit 195a7513ec

View File

@ -167,7 +167,10 @@ impl<TcInMemConverter: EcssTcInMemConverter, Scheduler: PusSchedulerInterface>
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use crate::pool::StaticMemoryPool; use core::time::Duration;
use crate::pool::{StaticMemoryPool, StaticPoolConfig};
use crate::pus::tests::TEST_APID;
use crate::{ use crate::{
events::EventU32, events::EventU32,
pus::{ pus::{
@ -179,6 +182,10 @@ mod tests {
}; };
use alloc::collections::VecDeque; use alloc::collections::VecDeque;
use delegate::delegate; use delegate::delegate;
use spacepackets::ecss::scheduling::Subservice;
use spacepackets::ecss::tc::PusTcSecondaryHeader;
use spacepackets::ecss::tm::{PusTmCreator, PusTmSecondaryHeader};
use spacepackets::SpHeader;
use spacepackets::{ use spacepackets::{
ecss::{tc::PusTcCreator, tm::PusTmReader}, ecss::{tc::PusTcCreator, tm::PusTmReader},
time::cds, time::cds,
@ -195,7 +202,9 @@ mod tests {
} }
impl Pus11HandlerWithStoreTester { impl Pus11HandlerWithStoreTester {
pub fn new(sched_tc_pool: StaticMemoryPool, scheduler: PusScheduler) -> Self { pub fn new(scheduler: PusScheduler) -> Self {
let pool_cfg = StaticPoolConfig::new(alloc::vec![(16, 16), (8, 32), (4, 64)]);
let sched_tc_pool = StaticMemoryPool::new(pool_cfg.clone());
let (common, srv_handler) = PusServiceHandlerWithSharedStoreCommon::new(); let (common, srv_handler) = PusServiceHandlerWithSharedStoreCommon::new();
Self { Self {
common, common,
@ -261,5 +270,14 @@ mod tests {
} }
#[test] #[test]
fn test_scheduling_tc() {} fn test_scheduling_tc() {
let scheduler = PusScheduler::new_with_current_init_time(Duration::from_secs(5))
.expect("Error creating scheduler");
let mut test_harness = Pus11HandlerWithStoreTester::new(scheduler);
let mut reply_header = SpHeader::tm_unseg(TEST_APID, 0, 0).unwrap();
let tc_header = PusTcSecondaryHeader::new_simple(11, Subservice::TcEnableSubschedule as u8);
let enable_scheduling = PusTcCreator::new(&mut reply_header, tc_header, &[], true);
let token = test_harness.send_tc(&enable_scheduling);
}
} }