some tests stuck now

This commit is contained in:
Robin Mueller
2026-01-16 13:14:01 +01:00
parent 55b8ecf2a6
commit bcbac6e886
3 changed files with 14 additions and 9 deletions
+1 -2
View File
@@ -179,8 +179,7 @@ impl Model for MagnetorquerModel {}
pub mod tests {
use std::time::Duration;
use models::pcdu::SwitchId;
use satrs::power::SwitchStateBinary;
use models::pcdu::{SwitchId, SwitchStateBinary};
use satrs_minisim::{
acs::{
lis3mdl::{self, MgmLis3MdlReply},
+2 -2
View File
@@ -69,8 +69,8 @@ impl Default for SwitchMapBinaryWrapper {
}
pub struct SwitchRequest {
switch_id: SwitchId,
target_state: SwitchStateBinary,
pub switch_id: SwitchId,
pub target_state: SwitchStateBinary,
}
impl SwitchRequest {
+11 -5
View File
@@ -476,11 +476,13 @@ mod tests {
sync::{mpsc, Arc},
};
use models::{pcdu::SwitchRequest, ComponentId};
use models::{
pcdu::{SwitchRequest, SwitchStateBinary},
ComponentId,
};
use satrs::{
mode::{ModeReply, ModeRequest},
mode_tree::ModeParent,
power::SwitchStateBinary,
request::GenericMessage,
tmtc::PacketAsVec,
};
@@ -572,7 +574,7 @@ mod tests {
let (tc_tx, tc_rx) = mpsc::sync_channel(10);
let (hk_reply_tx, _hk_reply_rx) = mpsc::sync_channel(10);
let (_tm_tx, tm_rx) = mpsc::sync_channel(10);
let (switcher_tx, switcher_rx) = mpsc::sync_channel(10);
let (switcher_tx, switch_rx) = mpsc::sync_channel(10);
let shared_mgm_set = Arc::default();
let shared_switch_set = SharedSwitchSet::default();
let mut handler = MgmHandlerLis3Mdl::new(
@@ -592,7 +594,7 @@ mod tests {
mode_reply_rx_to_pus: reply_rx_to_ground,
mode_reply_rx_to_parent: reply_rx_to_parent,
shared_switch_set,
switcher_rx,
switch_rx,
handler,
tm_rx,
tc_tx,
@@ -640,6 +642,7 @@ mod tests {
assert_eq!(testbench.handler.mode_and_submode().submode(), 0);
// Verify power switch handling.
/*
let mut switch_requests = testbench.handler.switch_helper.switch_requests.borrow_mut();
assert_eq!(switch_requests.len(), 1);
let switch_req = switch_requests.pop_front().expect("no switch request");
@@ -652,7 +655,10 @@ mod tests {
.borrow_mut();
assert_eq!(switch_info_requests.len(), 1);
let switch_info_req = switch_info_requests.pop_front().expect("no switch request");
assert_eq!(switch_info_req, SwitchId::Mgm0);
*/
let switch_req = testbench.switch_rx.try_recv().expect("no switch request");
assert_eq!(switch_req.message.switch_id, SwitchId::Mgm0);
assert_eq!(switch_req.message.target_state, SwitchStateBinary::On);
let mode_reply = testbench
.mode_reply_rx_to_pus