Skip to content

Commit

Permalink
TestSuite: amends for latest.
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed Jan 6, 2025
1 parent 0daaaec commit fc6b063
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
1 change: 1 addition & 0 deletions imgui_test_suite/imgui_tests_viewports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ static inline bool operator!=(const ImVec2& lhs, const ImVec2& rhs) { return lhs
// - Even if we don't implement the test right away: they allow us to remember edge cases and interesting things to test.
// - Even if they will be hard to actually implement/automate, they still allow us to manually check things.
//-------------------------------------------------------------------------
// TODO: Run test suite with negative coordinates viewports, as it is a frequent code for issues!
// TODO: Tests: Viewport: host A, viewport B over A, make new Modal appears where geometry overlap A -> SHOULD APPEAR OVER B
// TODO: Tests: Viewport: host A, viewport B over A, window C with TopMost, move over host A (may be merged) then drag over B -> SHOULD APPEAR OVER B AKA NOT MERGE IN A, OR, UNMERGE FROM A
// Actually same test is meaningful even without TopMost flag, since clicking C supposedly should bring it to front, C merged in A and dragging around B should appear over B
Expand Down
6 changes: 3 additions & 3 deletions imgui_test_suite/imgui_tests_widgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ void RegisterTests_Widgets(ImGuiTestEngine* e)
for (int data_type = 0; data_type < ImGuiDataType_COUNT; data_type++)
{
#if IMGUI_VERSION_NUM >= 19094
if (data_type == ImGuiDataType_Bool)
if (data_type == ImGuiDataType_Bool || data_type == ImGuiDataType_String)
continue;
#endif
size_t data_size = ImGui::DataTypeGetInfo(data_type)->Size;
Expand Down Expand Up @@ -5285,7 +5285,7 @@ void RegisterTests_Widgets(ImGuiTestEngine* e)
for (ImGuiDataType data_type = 0; data_type < ImGuiDataType_COUNT; data_type++)
{
#if IMGUI_VERSION_NUM >= 19094
if (data_type == ImGuiDataType_Bool)
if (data_type == ImGuiDataType_Bool || data_type == ImGuiDataType_String)
continue;
#endif
const ImGuiDataTypeInfo* data_type_info = ImGui::DataTypeGetInfo(data_type);
Expand Down Expand Up @@ -5320,7 +5320,7 @@ void RegisterTests_Widgets(ImGuiTestEngine* e)
for (int data_type = 0; data_type < ImGuiDataType_COUNT; data_type++)
{
#if IMGUI_VERSION_NUM >= 19094
if (data_type == ImGuiDataType_Bool)
if (data_type == ImGuiDataType_Bool || data_type == ImGuiDataType_String)
continue;
#endif
for (int invert_range = 0; invert_range < 2; invert_range++)
Expand Down
19 changes: 9 additions & 10 deletions shared/imgui_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Index of this file:
// [SECTION] ImGuiApp Implementation: SDL + OpenGL3
// [SECTION] ImGuiApp Implementation: GLFW + OpenGL3
// [SECTION] ImGuiApp Implementation: OpenGL (Shared)
// [SECTION] Mock backend for multi-viewports (Shared): The viewports are not visible
*/

Expand Down Expand Up @@ -120,7 +121,7 @@ bool ImGuiApp_ScreenCaptureFunc(ImGuiID viewport_id, int x, int y, int w, int h,
//-----------------------------------------------------------------------------

#ifdef IMGUI_HAS_VIEWPORT
static void ImGuiApp_InstalMockViewportsBackend(ImGuiApp*);
static void ImGuiApp_InstallMockViewportsBackend(ImGuiApp*);
#endif

// Data
Expand All @@ -135,7 +136,7 @@ static void ImGuiApp_ImplNull_InitBackends(ImGuiApp* app)
#ifdef IMGUI_HAS_VIEWPORT
ImGuiIO& io = ImGui::GetIO();
if (app->MockViewports && (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable))
ImGuiApp_InstalMockViewportsBackend(app);
ImGuiApp_InstallMockViewportsBackend(app);
#else
IM_UNUSED(app);
#endif
Expand Down Expand Up @@ -348,7 +349,7 @@ static void ImGuiApp_ImplWin32DX11_InitBackends(ImGuiApp* app_opaque)
#ifdef IMGUI_HAS_VIEWPORT
ImGuiIO& io = ImGui::GetIO();
if (app->MockViewports && (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable))
ImGuiApp_InstalMockViewportsBackend(app);
ImGuiApp_InstallMockViewportsBackend(app);
#endif
}

Expand Down Expand Up @@ -714,7 +715,7 @@ static void ImGuiApp_ImplSdlGL2_InitBackends(ImGuiApp* app_opaque)
#ifdef IMGUI_HAS_VIEWPORT
ImGuiIO& io = ImGui::GetIO();
if (app->MockViewports && (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable))
ImGuiApp_InstalMockViewportsBackend(app);
ImGuiApp_InstallMockViewportsBackend(app);
#endif
}

Expand Down Expand Up @@ -860,7 +861,7 @@ static void ImGuiApp_ImplSdlGL3_InitBackends(ImGuiApp* app_opaque)
#ifdef IMGUI_HAS_VIEWPORT
ImGuiIO& io = ImGui::GetIO();
if (app->MockViewports && (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable))
ImGuiApp_InstalMockViewportsBackend(app);
ImGuiApp_InstallMockViewportsBackend(app);
#endif
}

Expand Down Expand Up @@ -1068,7 +1069,7 @@ static void ImGuiApp_ImplGlfw_InitBackends(ImGuiApp* app_opaque)
#ifdef IMGUI_HAS_VIEWPORT
ImGuiIO& io = ImGui::GetIO();
if (app->MockViewports && (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable))
ImGuiApp_InstalMockViewportsBackend(app);
ImGuiApp_InstallMockViewportsBackend(app);
#endif
}

Expand Down Expand Up @@ -1200,13 +1201,11 @@ static bool ImGuiApp_ImplGL_CaptureFramebuffer(ImGuiApp* app, ImGuiViewport* vie
#endif

//-----------------------------------------------------------------------------
// [SECTION] Mock backend for multi-viewports (Shared)
// The viewports are not visible
// [SECTION] Mock backend for multi-viewports (Shared): The viewports are not visible
//-----------------------------------------------------------------------------

#ifdef IMGUI_HAS_VIEWPORT


// A virtual window
struct ImGui_ImplMockViewport_ViewportData
{
Expand Down Expand Up @@ -1239,7 +1238,7 @@ static ImGui_ImplMockViewport_ViewportData* ImGui_ImplNullViewport_FindViewportD
}

// Mock backend (viewports not visible)
static void ImGuiApp_InstalMockViewportsBackend(ImGuiApp*)
static void ImGuiApp_InstallMockViewportsBackend(ImGuiApp*)
{
ImGuiIO& io = ImGui::GetIO();

Expand Down

0 comments on commit fc6b063

Please sign in to comment.