Skip to content

Commit 620add3

Browse files
committed
TestSuite: update for IMGUI_VERSION_NUM=18984 + amend "widgets_multiselect_3_multiple"
1 parent b3f8937 commit 620add3

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

imgui_test_suite/imgui_tests_core.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3661,7 +3661,10 @@ void RegisterTests_Misc(ImGuiTestEngine* e)
36613661
clipper.Begin(vars.ItemsIn, ImGui::GetTextLineHeightWithSpacing());
36623662
else
36633663
clipper.Begin(vars.ItemsIn);
3664-
#if IMGUI_VERSION_NUM >= 18509
3664+
#if IMGUI_VERSION_NUM >= 18984
3665+
if (vars.ForceDisplayStart != vars.ForceDisplayEnd)
3666+
clipper.IncludeItemsByIndex(vars.ForceDisplayStart, vars.ForceDisplayEnd);
3667+
#elif IMGUI_VERSION_NUM >= 18509
36653668
if (vars.ForceDisplayStart != vars.ForceDisplayEnd)
36663669
clipper.IncludeRangeByIndices(vars.ForceDisplayStart, vars.ForceDisplayEnd);
36673670
#endif

imgui_test_suite/imgui_tests_widgets.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3302,7 +3302,7 @@ void RegisterTests_Widgets(ImGuiTestEngine* e)
33023302
ImGuiListClipper clipper;
33033303
clipper.Begin(ITEMS_COUNT);
33043304
if (ms_io->RangeSrcItem > 0)
3305-
clipper.IncludeByIndex(selection.ItemDataToIndex(ms_io->RangeSrcItem));
3305+
clipper.IncludeItemByIndex(selection.ItemDataToIndex(ms_io->RangeSrcItem));
33063306
while (clipper.Step())
33073307
{
33083308
for (int item_n = clipper.DisplayStart; item_n < clipper.DisplayEnd; item_n++)
@@ -3570,6 +3570,20 @@ void RegisterTests_Widgets(ImGuiTestEngine* e)
35703570
ctx->KeyPress(ImGuiMod_Ctrl | ImGuiKey_A);
35713571
IM_CHECK_EQ(selection0.SelectionSize, 1);
35723572
IM_CHECK_EQ(selection1.SelectionSize, 10);
3573+
3574+
// Check leaving a scope with keyboard directional move
3575+
// May need to clarify how this behave depending on "leaving" source, as mouse clicks don't impact this.
3576+
#if IMGUI_VERSION_NUM >= 18983
3577+
ctx->ItemClick("Scope 1/Object 0000");
3578+
IM_CHECK_EQ(selection0.SelectionSize, 1);
3579+
IM_CHECK_EQ(selection1.SelectionSize, 1);
3580+
ctx->KeyPress(ImGuiKey_UpArrow);
3581+
IM_CHECK_EQ(selection0.SelectionSize, 1);
3582+
IM_CHECK_EQ(selection1.SelectionSize, 0);
3583+
ctx->KeyPress(ImGuiKey_DownArrow);
3584+
IM_CHECK_EQ(selection0.SelectionSize, 0);
3585+
IM_CHECK_EQ(selection1.SelectionSize, 1);
3586+
#endif
35733587
};
35743588

35753589
// Test mouse-right click on unfocused window

0 commit comments

Comments
 (0)