Salome HOME
debug of tests on Linux
[modules/hydro.git] / src / HYDRO_tests / test_Overview.cxx
index 3bba27d48f7bf412ac3e9a7eeb03238f8625226e..a58fca22aa107f706d2bc6a84cfe9e4193e605d0 100644 (file)
@@ -112,6 +112,7 @@ void test_Overview::showShape()
   BRep_Builder B;
   TopoDS_Shape shape;
   std::string fname = (REF_DATA_PATH + "/test_zone.brep").toStdString();
+  //std::cout << "Loading shape: " << fname << std::endl;
   BRepTools::Read( shape, fname.c_str(), B );
   TestViewer::show( shape, AIS_Shaded, true, 0x03399FF );
   
@@ -159,13 +160,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 +211,29 @@ 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();
+  QTest::mouseMove( TestViewer::viewWindow() );
+
+  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::mouseMove( myOverview->getViewPort(false), QPoint( 150, 50 ) );
+  QTest::mouseClick( myOverview->getViewPort(false), Qt::LeftButton, Qt::KeyboardModifiers(), QPoint( 150, 50 ) );
+  qApp->processEvents();
+
+  CPPUNIT_ASSERT_OVERVIEW( "overview_drag" );
+
+  //QTest::qWait( 50000 );
 }