|
|
@ -8,18 +8,18 @@ use crate::modules::stream_states::state_update::StateUpdate;
|
|
|
|
fn has_all_enums() {
|
|
|
|
fn has_all_enums() {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let members = [
|
|
|
|
let members = [
|
|
|
|
s_s::enums::SubScenes::CameraDefault,
|
|
|
|
s_s::scenes::SubScenes::CameraDefault,
|
|
|
|
s_s::enums::SubScenes::CameraWithUpperRight,
|
|
|
|
s_s::scenes::SubScenes::CameraWithUpperRight,
|
|
|
|
s_s::enums::SubScenes::CameraWithLowerRight,
|
|
|
|
s_s::scenes::SubScenes::CameraWithLowerRight,
|
|
|
|
s_s::enums::SubScenes::CameraWithLargeUpperRight,
|
|
|
|
s_s::scenes::SubScenes::CameraWithLargeUpperRight,
|
|
|
|
];
|
|
|
|
];
|
|
|
|
assert_eq!(members.len(), 4);
|
|
|
|
assert_eq!(members.len(), 4);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let members = [
|
|
|
|
let members = [
|
|
|
|
s_s::enums::SubScenes::ScreenDefault,
|
|
|
|
s_s::scenes::SubScenes::ScreenDefault,
|
|
|
|
s_s::enums::SubScenes::ScreenWithUpperRight,
|
|
|
|
s_s::scenes::SubScenes::ScreenWithUpperRight,
|
|
|
|
s_s::enums::SubScenes::ScreenWithLowerRight,
|
|
|
|
s_s::scenes::SubScenes::ScreenWithLowerRight,
|
|
|
|
];
|
|
|
|
];
|
|
|
|
assert_eq!(members.len(), 3);
|
|
|
|
assert_eq!(members.len(), 3);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -38,56 +38,56 @@ fn create_stream_states_class() {
|
|
|
|
assert_eq!(stream_state.timer_length, 15.0);
|
|
|
|
assert_eq!(stream_state.timer_length, 15.0);
|
|
|
|
assert_eq!(stream_state.timer_can_run, true);
|
|
|
|
assert_eq!(stream_state.timer_can_run, true);
|
|
|
|
|
|
|
|
|
|
|
|
assert_eq!(stream_state.current_scene, s_s::enums::Scenes::Camera);
|
|
|
|
assert_eq!(stream_state.current_scene, s_s::scenes::Scenes::Camera);
|
|
|
|
assert_eq!(stream_state.camera_sub_scene, s_s::enums::SubScenes::CameraDefault);
|
|
|
|
assert_eq!(stream_state.camera_sub_scene, s_s::scenes::SubScenes::CameraDefault);
|
|
|
|
assert_eq!(stream_state.screen_sub_scene, s_s::enums::SubScenes::ScreenDefault);
|
|
|
|
assert_eq!(stream_state.screen_sub_scene, s_s::scenes::SubScenes::ScreenDefault);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
#[test]
|
|
|
|
fn scene_correctness(){
|
|
|
|
fn scene_correctness(){
|
|
|
|
let mut stream_state = s_s::stream_states_class::StreamState::new();
|
|
|
|
let mut stream_state = s_s::stream_states_class::StreamState::new();
|
|
|
|
assert_eq!(stream_state.current_scene, s_s::enums::Scenes::Camera);
|
|
|
|
assert_eq!(stream_state.current_scene, s_s::scenes::Scenes::Camera);
|
|
|
|
assert_eq!(stream_state.camera_sub_scene, s_s::enums::SubScenes::CameraDefault);
|
|
|
|
assert_eq!(stream_state.camera_sub_scene, s_s::scenes::SubScenes::CameraDefault);
|
|
|
|
assert_eq!(stream_state.screen_sub_scene, s_s::enums::SubScenes::ScreenDefault);
|
|
|
|
assert_eq!(stream_state.screen_sub_scene, s_s::scenes::SubScenes::ScreenDefault);
|
|
|
|
|
|
|
|
|
|
|
|
stream_state.update(StateUpdate::SubScene(s_s::enums::SubScenes::CameraWithUpperRight));
|
|
|
|
stream_state.update(StateUpdate::SubScene(s_s::scenes::SubScenes::CameraWithUpperRight));
|
|
|
|
|
|
|
|
|
|
|
|
assert_eq!(stream_state.camera_sub_scene, s_s::enums::SubScenes::CameraWithUpperRight);
|
|
|
|
assert_eq!(stream_state.camera_sub_scene, s_s::scenes::SubScenes::CameraWithUpperRight);
|
|
|
|
assert_eq!(stream_state.screen_sub_scene, s_s::enums::SubScenes::ScreenDefault);
|
|
|
|
assert_eq!(stream_state.screen_sub_scene, s_s::scenes::SubScenes::ScreenDefault);
|
|
|
|
|
|
|
|
|
|
|
|
stream_state.update(StateUpdate::SubScene(s_s::enums::SubScenes::CameraWithLargeUpperRight));
|
|
|
|
stream_state.update(StateUpdate::SubScene(s_s::scenes::SubScenes::CameraWithLargeUpperRight));
|
|
|
|
|
|
|
|
|
|
|
|
assert_eq!(stream_state.camera_sub_scene, s_s::enums::SubScenes::CameraWithLargeUpperRight);
|
|
|
|
assert_eq!(stream_state.camera_sub_scene, s_s::scenes::SubScenes::CameraWithLargeUpperRight);
|
|
|
|
assert_eq!(stream_state.screen_sub_scene, s_s::enums::SubScenes::ScreenDefault);
|
|
|
|
assert_eq!(stream_state.screen_sub_scene, s_s::scenes::SubScenes::ScreenDefault);
|
|
|
|
|
|
|
|
|
|
|
|
stream_state.update(StateUpdate::SubScene(s_s::enums::SubScenes::CameraWithLowerRight));
|
|
|
|
stream_state.update(StateUpdate::SubScene(s_s::scenes::SubScenes::CameraWithLowerRight));
|
|
|
|
|
|
|
|
|
|
|
|
assert_eq!(stream_state.camera_sub_scene, s_s::enums::SubScenes::CameraWithLowerRight);
|
|
|
|
assert_eq!(stream_state.camera_sub_scene, s_s::scenes::SubScenes::CameraWithLowerRight);
|
|
|
|
assert_eq!(stream_state.screen_sub_scene, s_s::enums::SubScenes::ScreenDefault);
|
|
|
|
assert_eq!(stream_state.screen_sub_scene, s_s::scenes::SubScenes::ScreenDefault);
|
|
|
|
|
|
|
|
|
|
|
|
stream_state.update(StateUpdate::SubScene(s_s::enums::SubScenes::ScreenDefault));
|
|
|
|
stream_state.update(StateUpdate::SubScene(s_s::scenes::SubScenes::ScreenDefault));
|
|
|
|
stream_state.update(StateUpdate::Scene(s_s::enums::Scenes::Screen));
|
|
|
|
stream_state.update(StateUpdate::Scene(s_s::scenes::Scenes::Screen));
|
|
|
|
|
|
|
|
|
|
|
|
assert_eq!(stream_state.current_scene, s_s::enums::Scenes::Screen);
|
|
|
|
assert_eq!(stream_state.current_scene, s_s::scenes::Scenes::Screen);
|
|
|
|
assert_eq!(stream_state.screen_sub_scene, s_s::enums::SubScenes::ScreenDefault);
|
|
|
|
assert_eq!(stream_state.screen_sub_scene, s_s::scenes::SubScenes::ScreenDefault);
|
|
|
|
assert_eq!(stream_state.camera_sub_scene, s_s::enums::SubScenes::CameraWithLowerRight);
|
|
|
|
assert_eq!(stream_state.camera_sub_scene, s_s::scenes::SubScenes::CameraWithLowerRight);
|
|
|
|
|
|
|
|
|
|
|
|
stream_state.update(StateUpdate::SubScene(s_s::enums::SubScenes::ScreenWithLowerRight));
|
|
|
|
stream_state.update(StateUpdate::SubScene(s_s::scenes::SubScenes::ScreenWithLowerRight));
|
|
|
|
|
|
|
|
|
|
|
|
assert_eq!(stream_state.screen_sub_scene, s_s::enums::SubScenes::ScreenWithLowerRight);
|
|
|
|
assert_eq!(stream_state.screen_sub_scene, s_s::scenes::SubScenes::ScreenWithLowerRight);
|
|
|
|
assert_eq!(stream_state.camera_sub_scene, s_s::enums::SubScenes::CameraWithLowerRight);
|
|
|
|
assert_eq!(stream_state.camera_sub_scene, s_s::scenes::SubScenes::CameraWithLowerRight);
|
|
|
|
|
|
|
|
|
|
|
|
stream_state.update(StateUpdate::SubScene(s_s::enums::SubScenes::ScreenWithUpperRight));
|
|
|
|
stream_state.update(StateUpdate::SubScene(s_s::scenes::SubScenes::ScreenWithUpperRight));
|
|
|
|
|
|
|
|
|
|
|
|
assert_eq!(stream_state.screen_sub_scene, s_s::enums::SubScenes::ScreenWithUpperRight);
|
|
|
|
assert_eq!(stream_state.screen_sub_scene, s_s::scenes::SubScenes::ScreenWithUpperRight);
|
|
|
|
assert_eq!(stream_state.camera_sub_scene, s_s::enums::SubScenes::CameraWithLowerRight);
|
|
|
|
assert_eq!(stream_state.camera_sub_scene, s_s::scenes::SubScenes::CameraWithLowerRight);
|
|
|
|
|
|
|
|
|
|
|
|
stream_state.update(StateUpdate::Scene(s_s::enums::Scenes::Augmented));
|
|
|
|
stream_state.update(StateUpdate::Scene(s_s::scenes::Scenes::Augmented));
|
|
|
|
|
|
|
|
|
|
|
|
assert_eq!(stream_state.current_scene, s_s::enums::Scenes::Augmented);
|
|
|
|
assert_eq!(stream_state.current_scene, s_s::scenes::Scenes::Augmented);
|
|
|
|
assert_eq!(stream_state.screen_sub_scene, s_s::enums::SubScenes::ScreenWithUpperRight);
|
|
|
|
assert_eq!(stream_state.screen_sub_scene, s_s::scenes::SubScenes::ScreenWithUpperRight);
|
|
|
|
assert_eq!(stream_state.camera_sub_scene, s_s::enums::SubScenes::CameraWithLowerRight);
|
|
|
|
assert_eq!(stream_state.camera_sub_scene, s_s::scenes::SubScenes::CameraWithLowerRight);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|