Add a unit test for wxCaret::Create()
Verify that constructing wxCaret using its default ctor and Create() works too, now that it does -- previously it uses to result in a GTK warning and a crash in wxGTK.
This commit is contained in:
@@ -136,10 +136,22 @@ TEST_CASE_METHOD(WindowTestCase, "Window::Mouse", "[window]")
|
|||||||
CHECK(m_window->GetCursor().IsOk());
|
CHECK(m_window->GetCursor().IsOk());
|
||||||
|
|
||||||
#if wxUSE_CARET
|
#if wxUSE_CARET
|
||||||
//A plain window doesn't have a caret
|
|
||||||
CHECK(!m_window->GetCaret());
|
CHECK(!m_window->GetCaret());
|
||||||
|
|
||||||
wxCaret* caret = new wxCaret(m_window, 16, 16);
|
wxCaret* caret;
|
||||||
|
|
||||||
|
// Try creating the caret in two different, but normally equivalent, ways.
|
||||||
|
SECTION("Caret 1-step")
|
||||||
|
{
|
||||||
|
caret = new wxCaret(m_window, 16, 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
SECTION("Caret 2-step")
|
||||||
|
{
|
||||||
|
caret = new wxCaret();
|
||||||
|
caret->Create(m_window, 16, 16);
|
||||||
|
}
|
||||||
|
|
||||||
m_window->SetCaret(caret);
|
m_window->SetCaret(caret);
|
||||||
|
|
||||||
CHECK(m_window->GetCaret()->IsOk());
|
CHECK(m_window->GetCaret()->IsOk());
|
||||||
|
Reference in New Issue
Block a user