From: asl Date: Fri, 22 Sep 2017 12:37:03 +0000 (+0300) Subject: debug of automatic tests X-Git-Tag: v2.1~66^2~26 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=81ab6fc9a713dbb6de983bdadbeb50d25487e9ec;p=modules%2Fhydro.git debug of automatic tests --- diff --git a/src/HYDRO_tests/TestViewer.cxx b/src/HYDRO_tests/TestViewer.cxx index 5ef6d2d9..34763265 100644 --- a/src/HYDRO_tests/TestViewer.cxx +++ b/src/HYDRO_tests/TestViewer.cxx @@ -274,6 +274,14 @@ bool TestViewer::AssertImages( QString& theMessage, const QImage* theImage, cons else anActualImage = viewWindow()->dumpView(); + const bool SWAP_RGB_ORDER = true; + if( SWAP_RGB_ORDER ) + { + // A temporary patch for bug in SALOME/OCC dump; the result image contains swapped RGB colors + anActualImage = anActualImage.rgbSwapped(); + } + + if( theCase ) myKey = theCase; diff --git a/src/HYDRO_tests/reference_data/Channel.png b/src/HYDRO_tests/reference_data/Channel.png index 369807de..346d861b 100644 Binary files a/src/HYDRO_tests/reference_data/Channel.png and b/src/HYDRO_tests/reference_data/Channel.png differ diff --git a/src/HYDRO_tests/reference_data/Extraction_Channel.png b/src/HYDRO_tests/reference_data/Extraction_Channel.png index 9ef6188a..a9e5c6ab 100644 Binary files a/src/HYDRO_tests/reference_data/Extraction_Channel.png and b/src/HYDRO_tests/reference_data/Extraction_Channel.png differ diff --git a/src/HYDRO_tests/reference_data/Extraction_ImmZone.png b/src/HYDRO_tests/reference_data/Extraction_ImmZone.png index 9e919787..3d9a2790 100644 Binary files a/src/HYDRO_tests/reference_data/Extraction_ImmZone.png and b/src/HYDRO_tests/reference_data/Extraction_ImmZone.png differ diff --git a/src/HYDRO_tests/reference_data/Merge_Polylines.png b/src/HYDRO_tests/reference_data/Merge_Polylines.png index 46e68bed..c90a95d5 100644 Binary files a/src/HYDRO_tests/reference_data/Merge_Polylines.png and b/src/HYDRO_tests/reference_data/Merge_Polylines.png differ diff --git a/src/HYDRO_tests/reference_data/Polyline_Presentation.png b/src/HYDRO_tests/reference_data/Polyline_Presentation.png index 1a4f14fd..3fc630ed 100644 Binary files a/src/HYDRO_tests/reference_data/Polyline_Presentation.png and b/src/HYDRO_tests/reference_data/Polyline_Presentation.png differ diff --git a/src/HYDRO_tests/reference_data/Shape_preview_im_zone.png b/src/HYDRO_tests/reference_data/Shape_preview_im_zone.png index fd1d1233..c41a5666 100644 Binary files a/src/HYDRO_tests/reference_data/Shape_preview_im_zone.png and b/src/HYDRO_tests/reference_data/Shape_preview_im_zone.png differ diff --git a/src/HYDRO_tests/reference_data/Split_Polylines_Colors.png b/src/HYDRO_tests/reference_data/Split_Polylines_Colors.png index 1915908f..b96b1d93 100644 Binary files a/src/HYDRO_tests/reference_data/Split_Polylines_Colors.png and b/src/HYDRO_tests/reference_data/Split_Polylines_Colors.png differ diff --git a/src/HYDRO_tests/reference_data/Split_Straight.png b/src/HYDRO_tests/reference_data/Split_Straight.png index c93ac469..89586780 100644 Binary files a/src/HYDRO_tests/reference_data/Split_Straight.png and b/src/HYDRO_tests/reference_data/Split_Straight.png differ diff --git a/src/HYDRO_tests/reference_data/StreamDlg.png b/src/HYDRO_tests/reference_data/StreamDlg.png index 69df6a0a..a8c3a6b4 100644 Binary files a/src/HYDRO_tests/reference_data/StreamDlg.png and b/src/HYDRO_tests/reference_data/StreamDlg.png differ diff --git a/src/HYDRO_tests/reference_data/cc_int_w_3.png b/src/HYDRO_tests/reference_data/cc_int_w_3.png index 53d94fec..bd03835b 100644 Binary files a/src/HYDRO_tests/reference_data/cc_int_w_3.png and b/src/HYDRO_tests/reference_data/cc_int_w_3.png differ diff --git a/src/HYDRO_tests/reference_data/st_dump.py b/src/HYDRO_tests/reference_data/st_dump.py index bedd58fa..79fa6acb 100644 --- a/src/HYDRO_tests/reference_data/st_dump.py +++ b/src/HYDRO_tests/reference_data/st_dump.py @@ -1,6 +1,6 @@ from HYDROPy import * -from PyQt4.QtCore import * -from PyQt4.QtGui import * +from PyQt5.QtCore import * +from PyQt5.QtGui import * hydro_doc = HYDROData_Document.Document( theStudy._get_StudyId() ) diff --git a/src/HYDRO_tests/reference_data/stream_dtm_2d.png b/src/HYDRO_tests/reference_data/stream_dtm_2d.png index 4ddd4ec9..ea1c4d38 100644 Binary files a/src/HYDRO_tests/reference_data/stream_dtm_2d.png and b/src/HYDRO_tests/reference_data/stream_dtm_2d.png differ diff --git a/src/HYDRO_tests/reference_data/stream_dtm_3d.png b/src/HYDRO_tests/reference_data/stream_dtm_3d.png index dca76771..2f0eb241 100644 Binary files a/src/HYDRO_tests/reference_data/stream_dtm_3d.png and b/src/HYDRO_tests/reference_data/stream_dtm_3d.png differ diff --git a/src/HYDRO_tests/test_GraphicsView.cxx b/src/HYDRO_tests/test_GraphicsView.cxx index 74d98977..8d9f6602 100644 --- a/src/HYDRO_tests/test_GraphicsView.cxx +++ b/src/HYDRO_tests/test_GraphicsView.cxx @@ -77,12 +77,19 @@ QRectF TestObject::boundingRect() const -#define CPPUNIT_ASSERT_VIEW( theCase ) \ - { \ - qApp->processEvents(); \ - QImage im = aViewPort->dumpView(); \ - CPPUNIT_ASSERT_IMAGES2( &im, theCase ); \ - } +#define CPPUNIT_ASSERT_VIEW( theCase ) \ + { \ + qApp->processEvents(); \ + QImage im = aViewPort->dumpView(); \ + const bool SWAP_RGB_ORDER = true; \ + if( SWAP_RGB_ORDER ) \ + { \ + /* A temporary patch for bug in SALOME/OCC dump; \ + the result image contains swapped RGB colors */ \ + im = im.rgbSwapped(); \ + } \ + CPPUNIT_ASSERT_IMAGES2( &im, theCase ); \ + } \ void test_GraphicsView::test_wheel_zoom() {