From: asl Date: Wed, 15 Nov 2017 12:51:23 +0000 (+0300) Subject: refs #1341: debug of automatic tests X-Git-Tag: v2.1~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=96ec23982d2f1a1c3acff1ba9ff7c015927d9e0e;p=modules%2Fhydro.git refs #1341: debug of automatic tests --- diff --git a/src/HYDRO_tests/TestViewer.cxx b/src/HYDRO_tests/TestViewer.cxx index d02aa1f7..36addda8 100644 --- a/src/HYDRO_tests/TestViewer.cxx +++ b/src/HYDRO_tests/TestViewer.cxx @@ -54,6 +54,7 @@ #endif #include +#include OCCViewer_ViewManager* TestViewer::myViewManager = 0; OCCViewer_ViewFrame* TestViewer::myViewWindow = 0; @@ -134,6 +135,8 @@ void TestViewer::eraseAll( bool isUpdate, bool eraseStructures ) GS->Erase(); } } + viewer()->setTrihedronShown( false ); + qApp->processEvents(); } void TestViewer::show( const Handle(AIS_InteractiveObject)& theObject, diff --git a/src/HYDRO_tests/reference_data/linux/Polyline_Presentation_triangle.png b/src/HYDRO_tests/reference_data/linux/Polyline_Presentation_triangle.png index 652ec440..18e185b8 100644 Binary files a/src/HYDRO_tests/reference_data/linux/Polyline_Presentation_triangle.png and b/src/HYDRO_tests/reference_data/linux/Polyline_Presentation_triangle.png differ diff --git a/src/HYDRO_tests/reference_data/linux/Split_Polylines_Colors.png b/src/HYDRO_tests/reference_data/linux/Split_Polylines_Colors.png index b96b1d93..184186f0 100644 Binary files a/src/HYDRO_tests/reference_data/linux/Split_Polylines_Colors.png and b/src/HYDRO_tests/reference_data/linux/Split_Polylines_Colors.png differ diff --git a/src/HYDRO_tests/reference_data/linux/Split_Straight.png b/src/HYDRO_tests/reference_data/linux/Split_Straight.png index 89586780..a7047964 100644 Binary files a/src/HYDRO_tests/reference_data/linux/Split_Straight.png and b/src/HYDRO_tests/reference_data/linux/Split_Straight.png differ diff --git a/src/HYDRO_tests/reference_data/linux/bathy_prs.png b/src/HYDRO_tests/reference_data/linux/bathy_prs.png index 1cffa732..838fd492 100644 Binary files a/src/HYDRO_tests/reference_data/linux/bathy_prs.png and b/src/HYDRO_tests/reference_data/linux/bathy_prs.png differ diff --git a/src/HYDRO_tests/reference_data/linux/bathy_prs_fit_selected.png b/src/HYDRO_tests/reference_data/linux/bathy_prs_fit_selected.png index d751826c..29260927 100644 Binary files a/src/HYDRO_tests/reference_data/linux/bathy_prs_fit_selected.png and b/src/HYDRO_tests/reference_data/linux/bathy_prs_fit_selected.png differ diff --git a/src/HYDRO_tests/reference_data/linux/bathy_rescaled_selection.png b/src/HYDRO_tests/reference_data/linux/bathy_rescaled_selection.png index 6f628ccc..2fa7a43e 100644 Binary files a/src/HYDRO_tests/reference_data/linux/bathy_rescaled_selection.png and b/src/HYDRO_tests/reference_data/linux/bathy_rescaled_selection.png differ diff --git a/src/HYDRO_tests/reference_data/linux/bathy_rescaled_user.png b/src/HYDRO_tests/reference_data/linux/bathy_rescaled_user.png index 3fa36a36..008c265c 100644 Binary files a/src/HYDRO_tests/reference_data/linux/bathy_rescaled_user.png and b/src/HYDRO_tests/reference_data/linux/bathy_rescaled_user.png differ diff --git a/src/HYDRO_tests/reference_data/linux/bathy_rescaled_visible.png b/src/HYDRO_tests/reference_data/linux/bathy_rescaled_visible.png index 1d70bc84..3470c260 100644 Binary files a/src/HYDRO_tests/reference_data/linux/bathy_rescaled_visible.png and b/src/HYDRO_tests/reference_data/linux/bathy_rescaled_visible.png differ diff --git a/src/HYDRO_tests/reference_data/linux/bathy_selection.png b/src/HYDRO_tests/reference_data/linux/bathy_selection.png index df5a5c5a..01d90f37 100644 Binary files a/src/HYDRO_tests/reference_data/linux/bathy_selection.png and b/src/HYDRO_tests/reference_data/linux/bathy_selection.png differ diff --git a/src/HYDRO_tests/reference_data/linux/bathy_text_labels.png b/src/HYDRO_tests/reference_data/linux/bathy_text_labels.png index 7b88665b..fdb46308 100644 Binary files a/src/HYDRO_tests/reference_data/linux/bathy_text_labels.png and b/src/HYDRO_tests/reference_data/linux/bathy_text_labels.png differ diff --git a/src/HYDRO_tests/reference_data/linux/diff_image.png b/src/HYDRO_tests/reference_data/linux/diff_image.png index f20ddb7f..afd7eb37 100644 Binary files a/src/HYDRO_tests/reference_data/linux/diff_image.png and b/src/HYDRO_tests/reference_data/linux/diff_image.png differ diff --git a/src/HYDRO_tests/reference_data/linux/gv_zoomed_1.png b/src/HYDRO_tests/reference_data/linux/gv_zoomed_1.png index 7d100270..f3ba468c 100644 Binary files a/src/HYDRO_tests/reference_data/linux/gv_zoomed_1.png and b/src/HYDRO_tests/reference_data/linux/gv_zoomed_1.png differ diff --git a/src/HYDRO_tests/reference_data/linux/gv_zoomed_2.png b/src/HYDRO_tests/reference_data/linux/gv_zoomed_2.png index b892b218..eb568a27 100644 Binary files a/src/HYDRO_tests/reference_data/linux/gv_zoomed_2.png and b/src/HYDRO_tests/reference_data/linux/gv_zoomed_2.png differ diff --git a/src/HYDRO_tests/reference_data/linux/merge_faces_boxes_13.png b/src/HYDRO_tests/reference_data/linux/merge_faces_boxes_13.png index a85f343c..adb97cf3 100644 Binary files a/src/HYDRO_tests/reference_data/linux/merge_faces_boxes_13.png and b/src/HYDRO_tests/reference_data/linux/merge_faces_boxes_13.png differ diff --git a/src/HYDRO_tests/reference_data/linux/merge_faces_boxes_14.png b/src/HYDRO_tests/reference_data/linux/merge_faces_boxes_14.png index 5cb66dad..bcc7bfaa 100644 Binary files a/src/HYDRO_tests/reference_data/linux/merge_faces_boxes_14.png and b/src/HYDRO_tests/reference_data/linux/merge_faces_boxes_14.png differ diff --git a/src/HYDRO_tests/reference_data/linux/merge_faces_boxes_21.png b/src/HYDRO_tests/reference_data/linux/merge_faces_boxes_21.png index 487d5ff8..2f47db4c 100644 Binary files a/src/HYDRO_tests/reference_data/linux/merge_faces_boxes_21.png and b/src/HYDRO_tests/reference_data/linux/merge_faces_boxes_21.png differ diff --git a/src/HYDRO_tests/reference_data/linux/merge_faces_boxes_22.png b/src/HYDRO_tests/reference_data/linux/merge_faces_boxes_22.png index d96c96c1..2a027e1c 100644 Binary files a/src/HYDRO_tests/reference_data/linux/merge_faces_boxes_22.png and b/src/HYDRO_tests/reference_data/linux/merge_faces_boxes_22.png differ diff --git a/src/HYDRO_tests/reference_data/linux/merge_faces_circles_12.png b/src/HYDRO_tests/reference_data/linux/merge_faces_circles_12.png index 4abe17aa..21888992 100644 Binary files a/src/HYDRO_tests/reference_data/linux/merge_faces_circles_12.png and b/src/HYDRO_tests/reference_data/linux/merge_faces_circles_12.png differ diff --git a/src/HYDRO_tests/reference_data/linux/merge_faces_circles_13.png b/src/HYDRO_tests/reference_data/linux/merge_faces_circles_13.png index 4b73eb8c..11abeb3b 100644 Binary files a/src/HYDRO_tests/reference_data/linux/merge_faces_circles_13.png and b/src/HYDRO_tests/reference_data/linux/merge_faces_circles_13.png differ diff --git a/src/HYDRO_tests/reference_data/linux/merge_faces_circles_14.png b/src/HYDRO_tests/reference_data/linux/merge_faces_circles_14.png index 4b73eb8c..11abeb3b 100644 Binary files a/src/HYDRO_tests/reference_data/linux/merge_faces_circles_14.png and b/src/HYDRO_tests/reference_data/linux/merge_faces_circles_14.png differ diff --git a/src/HYDRO_tests/reference_data/linux/merge_faces_circles_21.png b/src/HYDRO_tests/reference_data/linux/merge_faces_circles_21.png index ca1eb432..b0f0b8af 100644 Binary files a/src/HYDRO_tests/reference_data/linux/merge_faces_circles_21.png and b/src/HYDRO_tests/reference_data/linux/merge_faces_circles_21.png differ diff --git a/src/HYDRO_tests/reference_data/linux/overview_drag.png b/src/HYDRO_tests/reference_data/linux/overview_drag.png index d9c64263..c8c24167 100644 Binary files a/src/HYDRO_tests/reference_data/linux/overview_drag.png and b/src/HYDRO_tests/reference_data/linux/overview_drag.png differ diff --git a/src/HYDRO_tests/reference_data/linux/overview_empty.png b/src/HYDRO_tests/reference_data/linux/overview_empty.png index 1e37efd6..d650ce30 100644 Binary files a/src/HYDRO_tests/reference_data/linux/overview_empty.png and b/src/HYDRO_tests/reference_data/linux/overview_empty.png differ diff --git a/src/HYDRO_tests/reference_data/linux/overview_panned_1.png b/src/HYDRO_tests/reference_data/linux/overview_panned_1.png index 48c25af3..4027bede 100644 Binary files a/src/HYDRO_tests/reference_data/linux/overview_panned_1.png and b/src/HYDRO_tests/reference_data/linux/overview_panned_1.png differ diff --git a/src/HYDRO_tests/reference_data/linux/overview_prs.png b/src/HYDRO_tests/reference_data/linux/overview_prs.png index c2b37cf1..c989e7d0 100644 Binary files a/src/HYDRO_tests/reference_data/linux/overview_prs.png and b/src/HYDRO_tests/reference_data/linux/overview_prs.png differ diff --git a/src/HYDRO_tests/reference_data/linux/overview_rotated_1.png b/src/HYDRO_tests/reference_data/linux/overview_rotated_1.png index da4ab14d..b28710f0 100644 Binary files a/src/HYDRO_tests/reference_data/linux/overview_rotated_1.png and b/src/HYDRO_tests/reference_data/linux/overview_rotated_1.png differ diff --git a/src/HYDRO_tests/reference_data/linux/overview_selection.png b/src/HYDRO_tests/reference_data/linux/overview_selection.png index 417780e6..14cffa31 100644 Binary files a/src/HYDRO_tests/reference_data/linux/overview_selection.png and b/src/HYDRO_tests/reference_data/linux/overview_selection.png differ diff --git a/src/HYDRO_tests/reference_data/linux/overview_selection_a.png b/src/HYDRO_tests/reference_data/linux/overview_selection_a.png index 4af1406c..dbecfe4e 100644 Binary files a/src/HYDRO_tests/reference_data/linux/overview_selection_a.png and b/src/HYDRO_tests/reference_data/linux/overview_selection_a.png differ diff --git a/src/HYDRO_tests/reference_data/linux/overview_zoomed_1.png b/src/HYDRO_tests/reference_data/linux/overview_zoomed_1.png index 2944ba53..da9ec2b5 100644 Binary files a/src/HYDRO_tests/reference_data/linux/overview_zoomed_1.png and b/src/HYDRO_tests/reference_data/linux/overview_zoomed_1.png differ diff --git a/src/HYDRO_tests/reference_data/linux/overview_zoomed_2.png b/src/HYDRO_tests/reference_data/linux/overview_zoomed_2.png index 4c443cd9..712d335e 100644 Binary files a/src/HYDRO_tests/reference_data/linux/overview_zoomed_2.png and b/src/HYDRO_tests/reference_data/linux/overview_zoomed_2.png differ diff --git a/src/HYDRO_tests/reference_data/linux/stream_dtm_3d.png b/src/HYDRO_tests/reference_data/linux/stream_dtm_3d.png index 2f0eb241..18b9520c 100644 Binary files a/src/HYDRO_tests/reference_data/linux/stream_dtm_3d.png and b/src/HYDRO_tests/reference_data/linux/stream_dtm_3d.png differ diff --git a/src/HYDRO_tests/test_GraphicsView.cxx b/src/HYDRO_tests/test_GraphicsView.cxx index 8d9f6602..b4d23f43 100644 --- a/src/HYDRO_tests/test_GraphicsView.cxx +++ b/src/HYDRO_tests/test_GraphicsView.cxx @@ -93,6 +93,8 @@ QRectF TestObject::boundingRect() const void test_GraphicsView::test_wheel_zoom() { + TestViewer::eraseAll( true, true ); + GraphicsView_ViewManager* aViewManager = new GraphicsView_ViewManager( 0, 0 ); GraphicsView_Viewer* aViewer = new GraphicsView_Viewer( "test", 0 ); @@ -111,11 +113,13 @@ void test_GraphicsView::test_wheel_zoom() TestObject* obj = new TestObject(); aViewPort->addItem( obj ); aViewPort->fitAll(); + qApp->processEvents(); CPPUNIT_ASSERT_VIEW( "gv_fitall" ); // 2. Mouse wheel zoom QWheelEvent we1( QPoint( 10, 10 ), 120*10, Qt::NoButton, Qt::NoModifier ); qApp->sendEvent( aViewPort->viewport(), &we1 ); + qApp->processEvents(); CPPUNIT_ASSERT_VIEW( "gv_zoomed_1" ); //QTest::qWait( 50000 ); @@ -124,5 +128,9 @@ void test_GraphicsView::test_wheel_zoom() qApp->sendEvent( aViewPort->viewport(), &we2 ); CPPUNIT_ASSERT_VIEW( "gv_zoomed_2" ); + aWindow->setVisible(false); + aWindow->deleteLater(); + qApp->processEvents(); + //QTest::qWait( 50000 ); } diff --git a/src/HYDRO_tests/test_HYDROData_Main.cxx b/src/HYDRO_tests/test_HYDROData_Main.cxx index b9fbf305..a3c68444 100644 --- a/src/HYDRO_tests/test_HYDROData_Main.cxx +++ b/src/HYDRO_tests/test_HYDROData_Main.cxx @@ -75,7 +75,11 @@ int main( int argc, char* argv[] ) CppUnit::TestFactoryRegistry::getRegistry(); // Add the top suite to the test runner TestLib_Runner runner; +#ifdef WIN32 QString aPath = qgetenv( "HYDRO_SRC_DIR" ) + "/src/tests.cfg"; +#else + QString aPath = "/tmp/hydro/tests.cfg"; +#endif runner.Load( aPath.toStdString() ); runner.addTest( registry.makeTest() ); try diff --git a/src/HYDRO_tests/test_HYDROData_Stream.cxx b/src/HYDRO_tests/test_HYDROData_Stream.cxx index 86c3d676..338eb782 100644 --- a/src/HYDRO_tests/test_HYDROData_Stream.cxx +++ b/src/HYDRO_tests/test_HYDROData_Stream.cxx @@ -49,6 +49,8 @@ void test_HYDROData_Stream::tearDown() void test_HYDROData_Stream::test_dialog() { + TestViewer::eraseAll( true, true ); + HYDROGUI_StreamDlg* aDlg = new HYDROGUI_StreamDlg( 0, "stream" ); aDlg->show(); qApp->processEvents(); @@ -67,6 +69,8 @@ void test_HYDROData_Stream::test_dialog() void test_HYDROData_Stream::test_alt_object() { + TestViewer::eraseAll( true, true ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); Handle(HYDROData_Stream) aStream = @@ -87,6 +91,8 @@ void test_HYDROData_Stream::test_alt_object() void test_HYDROData_Stream::test_params_sync() { + TestViewer::eraseAll( true, true ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); Handle(HYDROData_Stream) aStream = @@ -138,6 +144,8 @@ void test_HYDROData_Stream::test_params_sync() void test_HYDROData_Stream::test_dump() { + TestViewer::eraseAll( true, true ); + // Case 1. Without hydraulic axis Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); @@ -227,6 +235,8 @@ void test_HYDROData_Stream::test_dump() void test_HYDROData_Stream::test_presentation() { + TestViewer::eraseAll( true, true ); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); TCollection_AsciiString fname = REF_DATA_PATH.toLatin1().data(); diff --git a/src/HYDRO_tests/test_HYDROGUI_BathymetryPrs.cxx b/src/HYDRO_tests/test_HYDROGUI_BathymetryPrs.cxx index f2c32cbd..4eec4f63 100644 --- a/src/HYDRO_tests/test_HYDROGUI_BathymetryPrs.cxx +++ b/src/HYDRO_tests/test_HYDROGUI_BathymetryPrs.cxx @@ -60,10 +60,9 @@ void test_HYDROGUI_BathymetryPrs::updateColors() myBathPrs->UpdateWithColorScale( TestViewer::colorScale() ); } - void test_HYDROGUI_BathymetryPrs::test_presentation() { - TestViewer::eraseAll( true ); + TestViewer::eraseAll( true, true ); Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); importTestBath( aDoc ); @@ -80,7 +79,7 @@ void test_HYDROGUI_BathymetryPrs::test_presentation() //QTest::qWait( 50000 ); aDoc->Close(); - TestViewer::eraseAll( true ); + TestViewer::eraseAll( true, true ); } void select( int x1, int y1, int x2, int y2 ) @@ -95,7 +94,7 @@ void select( int x1, int y1, int x2, int y2 ) void test_HYDROGUI_BathymetryPrs::test_selection() { - TestViewer::eraseAll( true ); + TestViewer::eraseAll( true, true ); Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); importTestBath( aDoc ); @@ -121,12 +120,12 @@ void test_HYDROGUI_BathymetryPrs::test_selection() //QTest::qWait( 50000 ); aDoc->Close(); - TestViewer::eraseAll( true ); + TestViewer::eraseAll( true, true ); } void test_HYDROGUI_BathymetryPrs::test_rescale_by_selection() { - TestViewer::eraseAll( true ); + TestViewer::eraseAll( true, true ); Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); importTestBath( aDoc ); @@ -180,12 +179,12 @@ void test_HYDROGUI_BathymetryPrs::test_rescale_by_selection() //QTest::qWait( 50000 ); aDoc->Close(); - TestViewer::eraseAll( true ); + TestViewer::eraseAll( true, true ); } void test_HYDROGUI_BathymetryPrs::test_rescale_by_visible() { - TestViewer::eraseAll( true ); + TestViewer::eraseAll( true, true ); Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); importTestBath( aDoc ); @@ -227,12 +226,12 @@ void test_HYDROGUI_BathymetryPrs::test_rescale_by_visible() //QTest::qWait( 50000 ); aDoc->Close(); - TestViewer::eraseAll( true ); + TestViewer::eraseAll( true, true ); } void test_HYDROGUI_BathymetryPrs::test_text_presentation() { - TestViewer::eraseAll( true ); + TestViewer::eraseAll( true, true ); Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); importTestBath( aDoc ); @@ -278,12 +277,12 @@ void test_HYDROGUI_BathymetryPrs::test_text_presentation() //QTest::qWait( 50000 ); aDoc->Close(); - TestViewer::eraseAll( true ); + TestViewer::eraseAll( true, true ); } void test_HYDROGUI_BathymetryPrs::test_rescale_default() { - TestViewer::eraseAll( true ); + TestViewer::eraseAll( true, true ); Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); importTestBath( aDoc ); @@ -335,12 +334,12 @@ void test_HYDROGUI_BathymetryPrs::test_rescale_default() //QTest::qWait( 50000 ); aDoc->Close(); - TestViewer::eraseAll( true ); + TestViewer::eraseAll( true, true ); } void test_HYDROGUI_BathymetryPrs::test_fit_on_selected() { - TestViewer::eraseAll( true ); + TestViewer::eraseAll( true, true ); Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); importTestBath( aDoc ); @@ -365,5 +364,5 @@ void test_HYDROGUI_BathymetryPrs::test_fit_on_selected() //QTest::qWait( 50000 ); aDoc->Close(); - TestViewer::eraseAll( true ); + TestViewer::eraseAll( true, true ); } diff --git a/src/HYDRO_tests/test_Overview.cxx b/src/HYDRO_tests/test_Overview.cxx index a58fca22..4fef7e21 100644 --- a/src/HYDRO_tests/test_Overview.cxx +++ b/src/HYDRO_tests/test_Overview.cxx @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -76,38 +77,45 @@ QImage test_Overview::dumpViews() painter.drawRect( WIDTH, WIDTH, w2, h2 ); painter.drawRect( w2+WIDTH, WIDTH, w1, h1 ); + //static int q = 0; + //q++; + //anOverview.save( QString( "/tmp/hydro/overview_" ) + QString::number( q ) + ".png" ); + //aMain.save( QString( "/tmp/hydro/main_" ) + QString::number( q ) + ".png" ); + painter.drawImage( WIDTH, WIDTH, anOverview ); painter.drawImage( w2+WIDTH, WIDTH, aMain ); - return pix.toImage(); + QImage res = pix.toImage(); + //res.save( QString( "/tmp/hydro/result_" ) + QString::number( q ) + ".png" ); + + return res; } void test_Overview::create() { - static bool isPassed = false; - if( isPassed ) - return; + TestViewer::eraseAll( true, true ); + + // Initialization of the empty viewer - // default mouse position - QTest::mouseMove( TestViewer::viewWindow(), QPoint( 0, 0 ) ); + static bool isCreated = false; + if( !isCreated ) + { + myOverview = new HYDROGUI_Overview( "Test overview" ); + myOverview->show(); - // Initialization of the empty viewer - myOverview = new HYDROGUI_Overview( "Test overview" ); - myOverview->show(); + // default mouse position + QTest::mouseMove( TestViewer::viewWindow(), QPoint( 0, 0 ) ); + + isCreated = true; + } myOverview->setMainView( TestViewer::viewWindow() ); TestViewer::viewWindow()->setGeometry( 400, 100, 800, 800 ); TestViewer::viewWindow()->onTopView(); myOverview->setGeometry( 100, 100, 200, 200 ); - - isPassed = true; } void test_Overview::showShape() { - static bool isPassed = false; - if( isPassed ) - return; - // Show loaded shape in the viewer BRep_Builder B; TopoDS_Shape shape; @@ -118,8 +126,6 @@ void test_Overview::showShape() qApp->processEvents(); myOverview->setTopView(); //TODO: automatic fit all on show???*/ - - isPassed = true; } void fitAllWithRestore( OCCViewer_ViewPort3d* vp ) @@ -159,14 +165,21 @@ void test_Overview::test_actions_in_main() create(); showShape(); TestViewer::viewWindow()->onTopView(); - - // 1. selection in main view - QTest::mouseMove( TestViewer::viewWindow() ); - CPPUNIT_ASSERT_OVERVIEW( "overview_selection" ); + qApp->processEvents(); OCCViewer_ViewWindow* aMain = TestViewer::viewWindow()->getView( OCCViewer_ViewFrame::MAIN_VIEW ); OCCViewer_ViewPort3d* vp = aMain->getViewPort(); + // 1. selection in main view + QTest::mouseMove( vp, QPoint(150,150) ); + TestViewer::context()->MoveTo(150, 150, vp->getView(), Standard_True ); + TestViewer::context()->Select( Standard_True ); + qApp->processEvents(); + //QTest::qWait( 50000 ); + //aMain->dumpView().save("/tmp/hydro/dump.png"); + //aMain->dumpView().rgbSwapped().save("/tmp/hydro/dump2.png"); + CPPUNIT_ASSERT_OVERVIEW( "overview_selection" ); + // 2. mouse wheel zoom QWheelEvent we( QPoint( 243, 416 ), 120*20, Qt::NoButton, Qt::NoModifier ); qApp->sendEvent( vp, &we ); @@ -203,7 +216,14 @@ void test_Overview::test_set_mainview_2_times() create(); showShape(); TestViewer::viewWindow()->onTopView(); - QTest::mouseMove( TestViewer::viewWindow() ); + + OCCViewer_ViewWindow* aMain = TestViewer::viewWindow()->getView( OCCViewer_ViewFrame::MAIN_VIEW ); + OCCViewer_ViewPort3d* vp = aMain->getViewPort(); + + QTest::mouseMove( vp, QPoint(150,150) ); + TestViewer::context()->MoveTo(150, 150, vp->getView(), Standard_True ); + TestViewer::context()->Select( Standard_True ); + qApp->processEvents(); //QTest::qWait( 20000 ); CPPUNIT_ASSERT_OVERVIEW( "overview_selection" ); @@ -219,11 +239,15 @@ void test_Overview::test_actions_in_overview() create(); showShape(); TestViewer::viewWindow()->onTopView(); - QTest::mouseMove( TestViewer::viewWindow() ); OCCViewer_ViewWindow* aMain = TestViewer::viewWindow()->getView( OCCViewer_ViewFrame::MAIN_VIEW ); OCCViewer_ViewPort3d* vp = aMain->getViewPort(); + QTest::mouseMove( vp, QPoint(150,150) ); + TestViewer::context()->MoveTo(150, 150, vp->getView(), Standard_True ); + TestViewer::context()->Select( Standard_True ); + qApp->processEvents(); + QWheelEvent we( QPoint( 243, 416 ), 120*20, Qt::NoButton, Qt::NoModifier ); qApp->sendEvent( vp, &we ); qApp->processEvents();