added debug_mode flag which disables external_interface

This commit is contained in:
Nickiel12 2021-12-30 11:42:46 -08:00
parent b183d821b6
commit 7c53786e3a
3 changed files with 7 additions and 1 deletions

View file

@ -21,6 +21,8 @@ pub struct StreamState {
pub current_scene: Scenes,
pub camera_sub_scene: SubScenes,
pub screen_sub_scene: SubScenes,
pub debug_mode: bool,
}
impl Default for StreamState {
@ -42,6 +44,8 @@ impl Default for StreamState {
current_scene: Scenes::Camera,
camera_sub_scene: SubScenes::CameraDefault,
screen_sub_scene: SubScenes::ScreenDefault,
debug_mode: false,
}
}
}

View file

@ -20,9 +20,10 @@ fn can_make_ctrl_c_handler() {
#[test]
fn test_updating_state_from_state_update() {
let mut state = StreamState::new();
state.debug_mode = true;
let update = StateUpdate::Scene(Scenes::Augmented);
//Update handled extensivly in stream_state_tests
state.handle_update(update);
state.update(update);
assert_eq!(state.current_scene, Scenes::Augmented);
}

View file

@ -4,6 +4,7 @@ use crate::modules::{message_handler::{MessageHandler}, stream_states::{state_up
#[test]
fn does_stream_state_implement_message_handler() {
let mut state = StreamState::new();
state.debug_mode = true;
state.handle_update(StateUpdate::ToggleComputerSoundOn(false));
assert_eq!(state.computer_sound_is_on, false);
}