Salome HOME
Merge branch 'BR_1328' into BR_DEMO
[modules/hydro.git] / src / HYDRO_tests / test_GraphicsView.cxx
index 74d98977d0a639c028149702585f5986c7a90826..8d9f660231b6916d13f8816c0f76a61e7adb7231 100644 (file)
@@ -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()
 {