Take the first control that moves the picture, not the first one drawn
`showing_the_original_leaves_the_edit_exactly_as_it_was` set row zero to its maximum and then asserted the photograph was modified. It was not, and the test failed on its own premise rather than on the thing it exists to check. `EditGraph::capabilities` puts the lens corrections at the head of the list, matching where they sit in the shader. Those carry profile coefficients rather than parameters, so with no profile loaded a slider on one is a control with nothing behind it: the graph stays neutral and the premise assertion fires. The test was written against a panel whose first row happened to be an adjustment, and it stopped being one. So it now walks the rows until it finds a control that actually changes the edit, which is what it meant by "row zero" all along. Still addressed by index, so it still names no operation, and it no longer depends on where in the chain the first *adjustment* happens to sit.
This commit is contained in:
+23
-23
File diff suppressed because one or more lines are too long
+19
-3
@@ -5805,9 +5805,25 @@ mod tests {
|
||||
let Some(ctx) = headless() else { return };
|
||||
let (mut session, _) = grey_session(&ctx);
|
||||
|
||||
// Addressed by index, so this names no operation (FR-DEV-3a).
|
||||
let row = session.rows()[0].clone();
|
||||
session.set_param(row.op_index, row.param_index, row.maximum);
|
||||
// The first control that actually moves the picture — addressed by
|
||||
// index, so this still names no operation (FR-DEV-3a).
|
||||
//
|
||||
// Deliberately not row zero. `EditGraph::capabilities` puts the lens
|
||||
// corrections first, matching where they sit in the shader, and those
|
||||
// carry profile coefficients rather than parameters: with no profile
|
||||
// loaded, driving one to its maximum leaves the graph neutral. Taking
|
||||
// the first row blindly made the premise below fail for a reason that
|
||||
// has nothing to do with what is being asserted.
|
||||
let rows = session.rows();
|
||||
let row = rows
|
||||
.iter()
|
||||
.find(|row| {
|
||||
session.set_param(row.op_index, row.param_index, row.maximum);
|
||||
!session.is_neutral()
|
||||
})
|
||||
.expect("some control in the panel moves the picture")
|
||||
.clone();
|
||||
let _ = row;
|
||||
|
||||
let edit = session.copy_settings();
|
||||
let steps = session.history_rows().len();
|
||||
|
||||
Reference in New Issue
Block a user