Skip to content

Commit bcbac6e

Browse files
committed
some tests stuck now
1 parent 55b8ecf commit bcbac6e

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

satrs-example/minisim/src/acs.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,7 @@ impl Model for MagnetorquerModel {}
179179
pub mod tests {
180180
use std::time::Duration;
181181

182-
use models::pcdu::SwitchId;
183-
use satrs::power::SwitchStateBinary;
182+
use models::pcdu::{SwitchId, SwitchStateBinary};
184183
use satrs_minisim::{
185184
acs::{
186185
lis3mdl::{self, MgmLis3MdlReply},

satrs-example/models/src/pcdu.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ impl Default for SwitchMapBinaryWrapper {
6969
}
7070

7171
pub struct SwitchRequest {
72-
switch_id: SwitchId,
73-
target_state: SwitchStateBinary,
72+
pub switch_id: SwitchId,
73+
pub target_state: SwitchStateBinary,
7474
}
7575

7676
impl SwitchRequest {

satrs-example/src/acs/mgm.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -476,11 +476,13 @@ mod tests {
476476
sync::{mpsc, Arc},
477477
};
478478

479-
use models::{pcdu::SwitchRequest, ComponentId};
479+
use models::{
480+
pcdu::{SwitchRequest, SwitchStateBinary},
481+
ComponentId,
482+
};
480483
use satrs::{
481484
mode::{ModeReply, ModeRequest},
482485
mode_tree::ModeParent,
483-
power::SwitchStateBinary,
484486
request::GenericMessage,
485487
tmtc::PacketAsVec,
486488
};
@@ -572,7 +574,7 @@ mod tests {
572574
let (tc_tx, tc_rx) = mpsc::sync_channel(10);
573575
let (hk_reply_tx, _hk_reply_rx) = mpsc::sync_channel(10);
574576
let (_tm_tx, tm_rx) = mpsc::sync_channel(10);
575-
let (switcher_tx, switcher_rx) = mpsc::sync_channel(10);
577+
let (switcher_tx, switch_rx) = mpsc::sync_channel(10);
576578
let shared_mgm_set = Arc::default();
577579
let shared_switch_set = SharedSwitchSet::default();
578580
let mut handler = MgmHandlerLis3Mdl::new(
@@ -592,7 +594,7 @@ mod tests {
592594
mode_reply_rx_to_pus: reply_rx_to_ground,
593595
mode_reply_rx_to_parent: reply_rx_to_parent,
594596
shared_switch_set,
595-
switcher_rx,
597+
switch_rx,
596598
handler,
597599
tm_rx,
598600
tc_tx,
@@ -640,6 +642,7 @@ mod tests {
640642
assert_eq!(testbench.handler.mode_and_submode().submode(), 0);
641643

642644
// Verify power switch handling.
645+
/*
643646
let mut switch_requests = testbench.handler.switch_helper.switch_requests.borrow_mut();
644647
assert_eq!(switch_requests.len(), 1);
645648
let switch_req = switch_requests.pop_front().expect("no switch request");
@@ -652,7 +655,10 @@ mod tests {
652655
.borrow_mut();
653656
assert_eq!(switch_info_requests.len(), 1);
654657
let switch_info_req = switch_info_requests.pop_front().expect("no switch request");
655-
assert_eq!(switch_info_req, SwitchId::Mgm0);
658+
*/
659+
let switch_req = testbench.switch_rx.try_recv().expect("no switch request");
660+
assert_eq!(switch_req.message.switch_id, SwitchId::Mgm0);
661+
assert_eq!(switch_req.message.target_state, SwitchStateBinary::On);
656662

657663
let mode_reply = testbench
658664
.mode_reply_rx_to_pus

0 commit comments

Comments
 (0)