Skip to content

Commit

Permalink
TestSuite: amend widgets_inputtext_callback_resize() for Str::capacit…
Browse files Browse the repository at this point in the history
…y() change.
  • Loading branch information
ocornut committed Nov 4, 2024
1 parent 8966398 commit 49f2cd4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions imgui_test_suite/imgui_tests_widgets_inputtext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1218,13 +1218,13 @@ void RegisterTests_WidgetsInputText(ImGuiTestEngine* e)
ImGui::Begin("Test Window", NULL, ImGuiWindowFlags_NoSavedSettings);
if (ImGui::InputText("Field1", &vars.str, ImGuiInputTextFlags_EnterReturnsTrue))
{
IM_CHECK_EQ(vars.str.capacity(), 4 + 5 + 1);
IM_CHECK_EQ(vars.str.capacity(), 4 + 5);
IM_CHECK_STR_EQ(vars.str.c_str(), "abcdhello");
}
Str str_local_unsaved = "abcd";
if (ImGui::InputText("Field2", &str_local_unsaved, ImGuiInputTextFlags_EnterReturnsTrue))
{
IM_CHECK_EQ(str_local_unsaved.capacity(), 4 + 5 + 1);
IM_CHECK_EQ(str_local_unsaved.capacity(), 4 + 5);
IM_CHECK_STR_EQ(str_local_unsaved.c_str(), "abcdhello");
}
ImGui::End();
Expand All @@ -1234,7 +1234,7 @@ void RegisterTests_WidgetsInputText(ImGuiTestEngine* e)
{
StrVars& vars = ctx->GetVars<StrVars>();
vars.str.set("abcd");
IM_CHECK_EQ(vars.str.capacity(), 4 + 1);
IM_CHECK_EQ(vars.str.capacity(), 4);
ctx->SetRef("Test Window");
ctx->ItemInput("Field1");
ctx->KeyCharsAppendEnter("hello");
Expand Down

0 comments on commit 49f2cd4

Please sign in to comment.