+ if( theImage1.isNull() || theImage2.isNull() )
+ return theImage1.isNull() == theImage2.isNull();
+
+ if( theImage1.size() != theImage2.size() )
+ return false;
+
+ int aBytesCount = theImage1.byteCount();
+ const uchar *aBytes1 = theImage1.constBits();
+ const uchar *aBytes2 = theImage2.constBits();
+ for( int i=0; i<aBytesCount; i++ )
+ if( aBytes1[i] != aBytes2[i] )
+ return false;
+
+ return true;
+}
+
+bool TestViewer::AssertEqual( const QString& theUseCaseName )
+{
+ QImage anActualImage = viewWindow()->dumpView();
+
+ QString anExpectedRefFilePath = qgetenv( "HYDRO_REFERENCE_DATA" );
+ anExpectedRefFilePath += "/" + theUseCaseName + ".png";
+ QImage anExpectedRefImage;
+ anExpectedRefImage.load( anExpectedRefFilePath );
+
+ if( AreImagesEqual( anActualImage, anExpectedRefImage ) )
+ return true;