From e4aadc2f1d645b939feb7a91da16b8d5e9f17778 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 29 Dec 2011 23:39:27 +0000 Subject: [PATCH] Update wxGrid unit tests after r70177. The row/column selection is not stored in the block arrays, see #12638. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70194 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- tests/controls/gridtest.cpp | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/tests/controls/gridtest.cpp b/tests/controls/gridtest.cpp index 6bde424215..34da0de16f 100644 --- a/tests/controls/gridtest.cpp +++ b/tests/controls/gridtest.cpp @@ -587,16 +587,9 @@ void GridTestCase::SelectionMode() m_grid->SetSelectionMode(wxGrid::wxGridSelectRows); m_grid->SelectBlock(3, 1, 3, 1); - wxGridCellCoordsArray topleft = m_grid->GetSelectionBlockTopLeft(); - wxGridCellCoordsArray bottomright = m_grid->GetSelectionBlockBottomRight(); - - CPPUNIT_ASSERT_EQUAL(1, topleft.Count()); - CPPUNIT_ASSERT_EQUAL(1, bottomright.Count()); - - CPPUNIT_ASSERT_EQUAL(0, topleft.Item(0).GetCol()); - CPPUNIT_ASSERT_EQUAL(3, topleft.Item(0).GetRow()); - CPPUNIT_ASSERT_EQUAL(1, bottomright.Item(0).GetCol()); - CPPUNIT_ASSERT_EQUAL(3, bottomright.Item(0).GetRow()); + wxArrayInt selectedRows = m_grid->GetSelectedRows(); + CPPUNIT_ASSERT_EQUAL(1, selectedRows.Count()); + CPPUNIT_ASSERT_EQUAL(3, selectedRows[0]); CPPUNIT_ASSERT_EQUAL(wxGrid::wxGridSelectRows, m_grid->GetSelectionMode()); @@ -607,16 +600,9 @@ void GridTestCase::SelectionMode() m_grid->SetSelectionMode(wxGrid::wxGridSelectColumns); m_grid->SelectBlock(3, 1, 3, 1); - topleft = m_grid->GetSelectionBlockTopLeft(); - bottomright = m_grid->GetSelectionBlockBottomRight(); - - CPPUNIT_ASSERT_EQUAL(1, topleft.Count()); - CPPUNIT_ASSERT_EQUAL(1, bottomright.Count()); - - CPPUNIT_ASSERT_EQUAL(1, topleft.Item(0).GetCol()); - CPPUNIT_ASSERT_EQUAL(0, topleft.Item(0).GetRow()); - CPPUNIT_ASSERT_EQUAL(1, bottomright.Item(0).GetCol()); - CPPUNIT_ASSERT_EQUAL(9, bottomright.Item(0).GetRow()); + wxArrayInt selectedCols = m_grid->GetSelectedCols(); + CPPUNIT_ASSERT_EQUAL(1, selectedCols.Count()); + CPPUNIT_ASSERT_EQUAL(1, selectedCols[0]); CPPUNIT_ASSERT_EQUAL(wxGrid::wxGridSelectColumns, m_grid->GetSelectionMode()); -- 2.45.2