From: asl Date: Fri, 3 Nov 2017 13:24:15 +0000 (+0300) Subject: corrections of tests for overview X-Git-Tag: v2.1~62 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=066de5503032bd43b088945889673bebd997e748;p=modules%2Fhydro.git corrections of tests for overview --- diff --git a/src/HYDRO_tests/reference_data/CMakeLists.txt b/src/HYDRO_tests/reference_data/CMakeLists.txt index 8957b095..bcdd3397 100644 --- a/src/HYDRO_tests/reference_data/CMakeLists.txt +++ b/src/HYDRO_tests/reference_data/CMakeLists.txt @@ -135,6 +135,7 @@ SET(REFERENCE_DATA overview_empty.png overview_prs.png overview_selection.png + overview_selection_a.png overview_zoomed_1.png overview_zoomed_2.png overview_panned_1.png diff --git a/src/HYDRO_tests/reference_data/overview_panned_1.png b/src/HYDRO_tests/reference_data/overview_panned_1.png index cf482f44..d1cdf9dd 100644 Binary files a/src/HYDRO_tests/reference_data/overview_panned_1.png and b/src/HYDRO_tests/reference_data/overview_panned_1.png differ diff --git a/src/HYDRO_tests/reference_data/overview_selection.png b/src/HYDRO_tests/reference_data/overview_selection.png index 18e18296..bff97cc5 100644 Binary files a/src/HYDRO_tests/reference_data/overview_selection.png and b/src/HYDRO_tests/reference_data/overview_selection.png differ diff --git a/src/HYDRO_tests/reference_data/overview_selection_a.png b/src/HYDRO_tests/reference_data/overview_selection_a.png new file mode 100644 index 00000000..18e18296 Binary files /dev/null and b/src/HYDRO_tests/reference_data/overview_selection_a.png differ diff --git a/src/HYDRO_tests/reference_data/overview_zoomed_2.png b/src/HYDRO_tests/reference_data/overview_zoomed_2.png index 169f8a79..1d58bc4f 100644 Binary files a/src/HYDRO_tests/reference_data/overview_zoomed_2.png and b/src/HYDRO_tests/reference_data/overview_zoomed_2.png differ diff --git a/src/HYDRO_tests/test_Overview.cxx b/src/HYDRO_tests/test_Overview.cxx index 3bba27d4..fe5f221b 100644 --- a/src/HYDRO_tests/test_Overview.cxx +++ b/src/HYDRO_tests/test_Overview.cxx @@ -159,13 +159,13 @@ void test_Overview::test_actions_in_main() showShape(); TestViewer::viewWindow()->onTopView(); - OCCViewer_ViewWindow* aMain = TestViewer::viewWindow()->getView( OCCViewer_ViewFrame::MAIN_VIEW ); - OCCViewer_ViewPort3d* vp = aMain->getViewPort(); - // 1. selection in main view QTest::mouseMove( TestViewer::viewWindow() ); CPPUNIT_ASSERT_OVERVIEW( "overview_selection" ); + OCCViewer_ViewWindow* aMain = TestViewer::viewWindow()->getView( OCCViewer_ViewFrame::MAIN_VIEW ); + OCCViewer_ViewPort3d* vp = aMain->getViewPort(); + // 2. mouse wheel zoom QWheelEvent we( QPoint( 243, 416 ), 120*20, Qt::NoButton, Qt::NoModifier ); qApp->sendEvent( vp, &we ); @@ -210,10 +210,22 @@ void test_Overview::test_set_mainview_2_times() myOverview->setMainView( TestViewer::viewWindow() ); qApp->processEvents(); - CPPUNIT_ASSERT_OVERVIEW( "overview_selection" ); + CPPUNIT_ASSERT_OVERVIEW( "overview_selection_a" ); } void test_Overview::test_actions_in_overview() { - //TODO + create(); + showShape(); + TestViewer::viewWindow()->onTopView(); + + OCCViewer_ViewWindow* aMain = TestViewer::viewWindow()->getView( OCCViewer_ViewFrame::MAIN_VIEW ); + OCCViewer_ViewPort3d* vp = aMain->getViewPort(); + + QWheelEvent we( QPoint( 243, 416 ), 120*20, Qt::NoButton, Qt::NoModifier ); + qApp->sendEvent( vp, &we ); + qApp->processEvents(); + CPPUNIT_ASSERT_OVERVIEW( "overview_zoomed_1" ); + + QTest::qWait( 50000 ); }