Route brush preset list planning
This commit is contained in:
@@ -1317,6 +1317,30 @@ if(TARGET pano_cli)
|
||||
LABELS "app;paint;integration;desktop-fast;fuzz"
|
||||
WILL_FAIL TRUE)
|
||||
|
||||
add_test(NAME pano_cli_plan_brush_preset_list_add_smoke
|
||||
COMMAND pano_cli plan-brush-preset-list --kind add --item-count 2)
|
||||
set_tests_properties(pano_cli_plan_brush_preset_list_add_smoke PROPERTIES
|
||||
LABELS "app;paint;integration;desktop-fast"
|
||||
PASS_REGULAR_EXPRESSION "\"command\":\"plan-brush-preset-list\".*\"operation\":\"add-current-brush\".*\"itemCount\":2.*\"targetIndex\":2.*\"savesList\":true.*\"updatesEmptyNotification\":true")
|
||||
|
||||
add_test(NAME pano_cli_plan_brush_preset_list_remove_only_smoke
|
||||
COMMAND pano_cli plan-brush-preset-list --kind remove --item-count 1 --current-index 0)
|
||||
set_tests_properties(pano_cli_plan_brush_preset_list_remove_only_smoke PROPERTIES
|
||||
LABELS "app;paint;integration;desktop-fast"
|
||||
PASS_REGULAR_EXPRESSION "\"command\":\"plan-brush-preset-list\".*\"operation\":\"remove-preset\".*\"itemCount\":1.*\"targetIndex\":-1.*\"selectsTarget\":false.*\"clearsSelection\":true")
|
||||
|
||||
add_test(NAME pano_cli_plan_brush_preset_list_move_edge_smoke
|
||||
COMMAND pano_cli plan-brush-preset-list --kind up --item-count 3 --current-index 0)
|
||||
set_tests_properties(pano_cli_plan_brush_preset_list_move_edge_smoke PROPERTIES
|
||||
LABELS "app;paint;integration;desktop-fast"
|
||||
PASS_REGULAR_EXPRESSION "\"command\":\"plan-brush-preset-list\".*\"operation\":\"move-preset\".*\"currentIndex\":0.*\"targetIndex\":0.*\"moveOffset\":-1.*\"noOp\":true")
|
||||
|
||||
add_test(NAME pano_cli_plan_brush_preset_list_select_smoke
|
||||
COMMAND pano_cli plan-brush-preset-list --kind select --item-count 3 --current-index 2)
|
||||
set_tests_properties(pano_cli_plan_brush_preset_list_select_smoke PROPERTIES
|
||||
LABELS "app;paint;integration;desktop-fast"
|
||||
PASS_REGULAR_EXPRESSION "\"command\":\"plan-brush-preset-list\".*\"operation\":\"select-preset\".*\"targetIndex\":2.*\"savesList\":false.*\"notifiesBrushChanged\":true")
|
||||
|
||||
add_test(NAME pano_cli_plan_brush_stroke_control_float_smoke
|
||||
COMMAND pano_cli plan-brush-stroke-control --kind float --setting tip-size --value 42.5)
|
||||
set_tests_properties(pano_cli_plan_brush_stroke_control_float_smoke PROPERTIES
|
||||
|
||||
@@ -404,6 +404,84 @@ void texture_list_remove_and_move_plans_handle_edges(pp::tests::Harness& harness
|
||||
PP_EXPECT(harness, !pp::app::plan_brush_texture_list_move(2, -1, 1));
|
||||
}
|
||||
|
||||
void preset_list_plans_add_select_move_remove_and_clear(pp::tests::Harness& harness)
|
||||
{
|
||||
const auto add = pp::app::plan_brush_preset_list_add(2, true);
|
||||
PP_EXPECT(harness, add);
|
||||
if (add) {
|
||||
PP_EXPECT(harness, add.value().operation == pp::app::BrushPresetListOperation::add_current_brush);
|
||||
PP_EXPECT(harness, add.value().target_index == 2);
|
||||
PP_EXPECT(harness, add.value().saves_list);
|
||||
PP_EXPECT(harness, add.value().updates_empty_notification);
|
||||
}
|
||||
|
||||
const auto select = pp::app::plan_brush_preset_list_select(3, 1);
|
||||
PP_EXPECT(harness, select);
|
||||
if (select) {
|
||||
PP_EXPECT(harness, select.value().operation == pp::app::BrushPresetListOperation::select_preset);
|
||||
PP_EXPECT(harness, select.value().target_index == 1);
|
||||
PP_EXPECT(harness, select.value().selects_target);
|
||||
PP_EXPECT(harness, select.value().notifies_brush_changed);
|
||||
PP_EXPECT(harness, !select.value().saves_list);
|
||||
}
|
||||
|
||||
const auto move_up_edge = pp::app::plan_brush_preset_list_move(3, 0, -1);
|
||||
PP_EXPECT(harness, move_up_edge);
|
||||
if (move_up_edge) {
|
||||
PP_EXPECT(harness, move_up_edge.value().target_index == 0);
|
||||
PP_EXPECT(harness, move_up_edge.value().no_op);
|
||||
PP_EXPECT(harness, move_up_edge.value().saves_list);
|
||||
}
|
||||
|
||||
const auto move_down = pp::app::plan_brush_preset_list_move(3, 1, 1);
|
||||
PP_EXPECT(harness, move_down);
|
||||
if (move_down) {
|
||||
PP_EXPECT(harness, move_down.value().operation == pp::app::BrushPresetListOperation::move_preset);
|
||||
PP_EXPECT(harness, move_down.value().target_index == 2);
|
||||
PP_EXPECT(harness, !move_down.value().no_op);
|
||||
}
|
||||
|
||||
const auto remove_middle = pp::app::plan_brush_preset_list_remove(3, 1);
|
||||
PP_EXPECT(harness, remove_middle);
|
||||
if (remove_middle) {
|
||||
PP_EXPECT(harness, remove_middle.value().operation == pp::app::BrushPresetListOperation::remove_preset);
|
||||
PP_EXPECT(harness, remove_middle.value().target_index == 1);
|
||||
PP_EXPECT(harness, remove_middle.value().selects_target);
|
||||
PP_EXPECT(harness, !remove_middle.value().clears_selection);
|
||||
PP_EXPECT(harness, remove_middle.value().saves_list);
|
||||
}
|
||||
|
||||
const auto remove_only = pp::app::plan_brush_preset_list_remove(1, 0);
|
||||
PP_EXPECT(harness, remove_only);
|
||||
if (remove_only) {
|
||||
PP_EXPECT(harness, remove_only.value().target_index == -1);
|
||||
PP_EXPECT(harness, !remove_only.value().selects_target);
|
||||
PP_EXPECT(harness, remove_only.value().clears_selection);
|
||||
}
|
||||
|
||||
const auto clear_empty = pp::app::plan_brush_preset_list_clear(0);
|
||||
PP_EXPECT(harness, clear_empty);
|
||||
if (clear_empty) {
|
||||
PP_EXPECT(harness, clear_empty.value().operation == pp::app::BrushPresetListOperation::clear_presets);
|
||||
PP_EXPECT(harness, clear_empty.value().no_op);
|
||||
PP_EXPECT(harness, clear_empty.value().saves_list);
|
||||
PP_EXPECT(harness, clear_empty.value().clears_selection);
|
||||
}
|
||||
}
|
||||
|
||||
void preset_list_plans_reject_breaking_points(pp::tests::Harness& harness)
|
||||
{
|
||||
PP_EXPECT(harness, !pp::app::plan_brush_preset_list_add(-1, true));
|
||||
PP_EXPECT(harness, !pp::app::plan_brush_preset_list_add(0, false));
|
||||
PP_EXPECT(harness, !pp::app::plan_brush_preset_list_select(0, 0));
|
||||
PP_EXPECT(harness, !pp::app::plan_brush_preset_list_select(2, 2));
|
||||
PP_EXPECT(harness, !pp::app::plan_brush_preset_list_remove(0, 0));
|
||||
PP_EXPECT(harness, !pp::app::plan_brush_preset_list_remove(2, -1));
|
||||
PP_EXPECT(harness, !pp::app::plan_brush_preset_list_move(2, 0, 0));
|
||||
PP_EXPECT(harness, !pp::app::plan_brush_preset_list_move(2, 3, 1));
|
||||
PP_EXPECT(harness, !pp::app::plan_brush_preset_list_clear(-1));
|
||||
}
|
||||
|
||||
void executor_dispatches_color_and_refresh(pp::tests::Harness& harness)
|
||||
{
|
||||
FakeBrushUiServices services;
|
||||
@@ -617,6 +695,8 @@ int main()
|
||||
harness.run("stroke control plans validate values and reject breaking points", stroke_control_plans_validate_values_and_reject_breaking_points);
|
||||
harness.run("texture list add plans target paths and rejects bad input", texture_list_add_plans_target_paths_and_rejects_bad_input);
|
||||
harness.run("texture list remove and move plans handle edges", texture_list_remove_and_move_plans_handle_edges);
|
||||
harness.run("preset list plans add select move remove and clear", preset_list_plans_add_select_move_remove_and_clear);
|
||||
harness.run("preset list plans reject breaking points", preset_list_plans_reject_breaking_points);
|
||||
harness.run("executor dispatches color and refresh", executor_dispatches_color_and_refresh);
|
||||
harness.run("executor dispatches texture and preset", executor_dispatches_texture_and_preset);
|
||||
harness.run("executor dispatches stroke refresh only", executor_dispatches_stroke_refresh_only);
|
||||
|
||||
Reference in New Issue
Block a user