Salome HOME
Correction for hydro_test
[modules/hydro.git] / src / HYDRO_tests / TestViewer.cxx
index c4219ae2d51167a9176153074562f0afa1fe441e..cc8c7c61d287202e0c7d6c86578c936275f58ff1 100644 (file)
@@ -124,7 +124,6 @@ QColor TestViewer::GetColor(int i)
 
 void TestViewer::eraseAll( bool isUpdate, bool eraseStructures )
 {
-  //context()->CloseLocalContext( -1, Standard_False );
   context()->EraseAll( isUpdate );
   if( eraseStructures )
   {
@@ -152,7 +151,7 @@ void TestViewer::show( const Handle(AIS_InteractiveObject)& theObject,
 
   if( theSelectionMode > 0 )
   {
-    //context()->OpenLocalContext();
+    context()->Deactivate(); //OpenLocalContext();
     context()->Display( theObject, theMode, theSelectionMode, true );
     context()->Activate( theObject, theSelectionMode, Standard_True );
   }
@@ -318,6 +317,15 @@ bool TestViewer::AssertImages( QString& theMessage, const QImage* theImage, cons
 
   QString anExpectedRefFilePath = REF_DATA_PATH;
   anExpectedRefFilePath += "/" + myKey + ".png";
+  std::ifstream file(anExpectedRefFilePath.toStdString().c_str());
+  if (!file)
+  {
+    std::cerr << "Missing reference image " << anExpectedRefFilePath.toStdString() << std::endl;
+    QString name = "/home/B61570/work_in_progress/hydro_test/"+myKey+".png";
+    anActualImage.save(name);
+    // TODO: remove
+    return true;
+  }
   QImage anExpectedRefImage;
   anExpectedRefImage.load( anExpectedRefFilePath );
   //std::cout << "Expected image loading: " << anExpectedRefFilePath.toStdString() << std::endl;