Skip to content

Commit

Permalink
Fix integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
helgoboss committed Dec 20, 2024
1 parent 61150bd commit 3a0fb21
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions main/src/infrastructure/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ async fn basics() {
// -inf (as opposed to SetMediaTrackInfo_Value with D_VOL) but that's another story.
assert_eq!(
realearn.track().volume().to_db_ex(Db::MINUS_INF),
Db::MINUS_150_DB,
MIN_VOLUME,
"NOTE OFF should turn down volume completely"
);
assert_eq!(
Expand All @@ -194,7 +194,7 @@ async fn basics() {
// Then
assert_eq!(
realearn.track().volume().to_db_ex(Db::MINUS_INF),
Db::MINUS_150_DB
MIN_VOLUME
);
assert_eq!(
realearn.pop_feedback(),
Expand Down Expand Up @@ -239,7 +239,7 @@ async fn nrpn_test() {
// Then
assert_eq!(
realearn.track().volume().to_db_ex(Db::MINUS_INF),
Db::MINUS_150_DB,
MIN_VOLUME,
"NOTE OFF should turn down volume completely"
);
assert_eq!(
Expand All @@ -256,12 +256,12 @@ async fn nrpn_test() {
// Then
assert_ne!(
realearn.track().volume().to_db_ex(Db::MINUS_INF),
Db::MINUS_150_DB,
MIN_VOLUME,
"increment should turn volume up a bit"
);
assert_eq!(
realearn.pop_feedback(),
vec![Midi(ParameterNumber(nrpn(0, 100, 2)))],
vec![Midi(ParameterNumber(nrpn(0, 100, 1)))],
"feedback should be sent on target value change"
);
// When
Expand All @@ -273,7 +273,7 @@ async fn nrpn_test() {
// Then
assert_eq!(
realearn.track().volume().to_db_ex(Db::MINUS_INF),
Db::MINUS_150_DB,
MIN_VOLUME,
"decrement should turn volume down a bit again"
);
assert_eq!(
Expand Down Expand Up @@ -318,7 +318,7 @@ async fn load_mapping_snapshot_all_mappings() {
// Then
assert_eq!(
realearn.track().volume().to_db_ex(Db::MINUS_INF),
Db::MINUS_150_DB,
MIN_VOLUME,
"volume should be MIN because muted"
);
assert_eq!(realearn.track().pan().reaper_value(), ReaperPanValue::LEFT);
Expand Down Expand Up @@ -396,7 +396,7 @@ async fn load_mapping_snapshot_some_mappings() {
// Then
assert_eq!(
realearn.track().volume().to_db_ex(Db::MINUS_INF),
Db::MINUS_150_DB,
MIN_VOLUME,
"volume should be MIN because muted"
);
assert_eq!(realearn.track().pan().reaper_value(), ReaperPanValue::LEFT);
Expand Down Expand Up @@ -675,7 +675,7 @@ async fn send_feedback_after_control_normal_mode_volume() {
// Then
assert_eq!(
realearn.track().volume().to_db_ex(Db::MINUS_INF),
Db::MINUS_150_DB
MIN_VOLUME
);
assert_eq!(
realearn.pop_feedback(),
Expand All @@ -687,7 +687,7 @@ async fn send_feedback_after_control_normal_mode_volume() {
// Then
assert_eq!(
realearn.track().volume().to_db_ex(Db::MINUS_INF),
Db::MINUS_150_DB
MIN_VOLUME
);
assert_eq!(
realearn.pop_feedback(),
Expand Down Expand Up @@ -720,7 +720,7 @@ async fn basics_controller_compartment() {
// Then
assert_eq!(
realearn.track().volume().to_db_ex(Db::MINUS_INF),
Db::MINUS_150_DB
MIN_VOLUME
);
assert_eq!(
realearn.pop_feedback(),
Expand Down Expand Up @@ -762,7 +762,7 @@ async fn virtual_mapping() {
// Then
assert_eq!(
realearn.track().volume().to_db_ex(Db::MINUS_INF),
Db::MINUS_150_DB
MIN_VOLUME
);
assert_eq!(
realearn.pop_feedback(),
Expand Down Expand Up @@ -865,7 +865,7 @@ async fn track_by_position() {
realearn.track().volume().to_db_ex(Db::MINUS_INF),
Db::ZERO_DB
);
assert_eq!(track_2.volume().to_db_ex(Db::MINUS_INF), Db::MINUS_150_DB);
assert_eq!(track_2.volume().to_db_ex(Db::MINUS_INF), MIN_VOLUME);
assert_eq!(
realearn.pop_feedback(),
vec![Midi(Plain(note_on(0, 64, 0)))],
Expand Down Expand Up @@ -1153,7 +1153,7 @@ async fn track_by_name() {
realearn.track().volume().to_db_ex(Db::MINUS_INF),
Db::ZERO_DB
);
assert_eq!(track_2.volume().to_db_ex(Db::MINUS_INF), Db::MINUS_150_DB);
assert_eq!(track_2.volume().to_db_ex(Db::MINUS_INF), MIN_VOLUME);
assert_eq!(
realearn.pop_feedback(),
vec![Midi(Plain(note_on(0, 64, 0)))],
Expand Down Expand Up @@ -1335,7 +1335,7 @@ async fn conditional_activation_program() {
// Then
assert_eq!(
realearn.track().volume().to_db_ex(Db::MINUS_INF),
Db::MINUS_150_DB
MIN_VOLUME
);
assert_eq!(
realearn.pop_feedback(),
Expand Down Expand Up @@ -1409,7 +1409,7 @@ async fn conditional_activation_eel() {
// Then
assert_eq!(
realearn.track().volume().to_db_ex(Db::MINUS_INF),
Db::MINUS_150_DB
MIN_VOLUME
);
assert_eq!(
realearn.pop_feedback(),
Expand Down Expand Up @@ -1583,3 +1583,5 @@ mod macos_impl {
}
}
}

const MIN_VOLUME: Db = Db::MINUS_INF;

0 comments on commit 3a0fb21

Please sign in to comment.