MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / TEST_F

Function TEST_F

tests/test_selection_operator_modal.cpp:210–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208};
209
210TEST_F(SelectionOperatorModalTest, PolygonOperatorUndoesOnlyFromBoundActionAndUnboundKeysPassThrough) {
211 set_initial_selection({1, 0});
212 service().setTestingScreenPositions(make_screen_positions({
213 80.0f,
214 80.0f,
215 10.0f,
216 10.0f,
217 }));
218
219 SelectionStrokeOperator op;
220 OperatorProperties props;
221 props.set("mode", 2);
222 props.set("op", 0);
223 props.set("x", 0.0);
224 props.set("y", 0.0);
225
226 EXPECT_EQ(op.invoke(*context_, props), OperatorResult::RUNNING_MODAL);
227 EXPECT_EQ(dispatch(op,
228 mouse_button(static_cast<int>(lfs::vis::input::AppMouseButton::LEFT),
229 lfs::vis::input::ACTION_PRESS, 30.0, 0.0),
230 props),
231 OperatorResult::RUNNING_MODAL);
232 EXPECT_EQ(dispatch(op,
233 mouse_button(static_cast<int>(lfs::vis::input::AppMouseButton::RIGHT),
234 lfs::vis::input::ACTION_PRESS, 30.0, 0.0),
235 props),
236 OperatorResult::PASS_THROUGH);
237 EXPECT_EQ(dispatch(op,
238 modal_action(lfs::vis::input::Action::UNDO_POLYGON_VERTEX),
239 props),
240 OperatorResult::RUNNING_MODAL);
241 EXPECT_TRUE(service().isInteractiveSelectionActive());
242
243 EXPECT_EQ(dispatch(op, key_press(lfs::vis::input::KEY_ESCAPE), props), OperatorResult::PASS_THROUGH);
244 op.cancel(*context_);
245
246 EXPECT_EQ(selection_values(*scene_manager_), (std::vector<uint8_t>{1, 0}));
247 EXPECT_FALSE(service().isInteractiveSelectionActive());
248}
249
250TEST_F(SelectionOperatorModalTest, PolygonOperatorUsesConfiguredRightButtonForVertices) {
251 set_initial_selection({1, 0});

Callers

nothing calls this directly

Calls 15

mouse_buttonFunction · 0.85
modal_actionFunction · 0.85
key_pressFunction · 0.85
mouse_moveFunction · 0.85
getSettingsMethod · 0.80
updateViewportBoundsMethod · 0.80
setDepthFilterRangeMethod · 0.80
setDepthFilterEnabledMethod · 0.80

Tested by

no test coverage detected