From: asl Date: Wed, 15 Nov 2017 07:33:56 +0000 (+0300) Subject: refs #1341: debug of difference image X-Git-Tag: v2.1~18^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=009886e34d3efa0ee0c860b6bcb1a2db718f098a;p=modules%2Fhydro.git refs #1341: debug of difference image --- diff --git a/src/HYDRO_tests/TestViewer.cxx b/src/HYDRO_tests/TestViewer.cxx index 6aa098d3..2ad31f82 100644 --- a/src/HYDRO_tests/TestViewer.cxx +++ b/src/HYDRO_tests/TestViewer.cxx @@ -186,6 +186,7 @@ void TestViewer::show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, if( isFitAll ) fitAll(); } + void TestViewer::show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const char* theKey, int theUIANb, int theVIANb) { @@ -277,6 +278,21 @@ bool AreImagesEqual( const QImage& theImage1, const QImage& theImage2, double th return true; } +QImage TestViewer::diff( const QImage& theExpectedRefImage, const QImage& theActualImage ) +{ + const QImage::Format aFormat = QImage::Format_RGB32; + + QImage anExpectedRefImage = theExpectedRefImage.convertToFormat( aFormat ); + QImage anActualImage = theActualImage.convertToFormat( aFormat ); + + QImage aDiff( anExpectedRefImage.width(), anExpectedRefImage.height(), aFormat ); + QPainter aPainter( &aDiff ); + aPainter.drawImage( 0, 0, anExpectedRefImage ); + aPainter.setCompositionMode( QPainter::RasterOp_SourceXorDestination ); + aPainter.drawImage( 0, 0, anActualImage ); + return aDiff; +} + bool TestViewer::AssertImages( QString& theMessage, const QImage* theImage, const char* theCase, bool swapRGB ) { QImage anActualImage; @@ -321,11 +337,7 @@ bool TestViewer::AssertImages( QString& theMessage, const QImage* theImage, cons //std::cout << anActualImage.width() << "x" << anActualImage.height() << std::endl; theMessage = "The viewer contents does not correspond to the reference image: " + myKey; - QImage aDiff( anExpectedRefImage.width(), anExpectedRefImage.height(), QImage::Format_ARGB32 ); - QPainter aPainter( &aDiff ); - aPainter.drawImage( 0, 0, anExpectedRefImage ); - aPainter.setCompositionMode( QPainter::RasterOp_SourceXorDestination ); - aPainter.drawImage( 0, 0, anActualImage ); + QImage aDiff = diff( anExpectedRefImage, anActualImage ); QString aDiffFilePath = temp + "/" + myKey + "_diff.png"; aDiff.save( aDiffFilePath ); diff --git a/src/HYDRO_tests/TestViewer.h b/src/HYDRO_tests/TestViewer.h index af8400f0..7a0fcab3 100644 --- a/src/HYDRO_tests/TestViewer.h +++ b/src/HYDRO_tests/TestViewer.h @@ -62,6 +62,7 @@ public: static void setKey( const QString& ); static void fitAll(); + static QImage diff( const QImage& im1, const QImage& im2 ); private: static OCCViewer_ViewManager* myViewManager; diff --git a/src/HYDRO_tests/reference_data/CMakeLists.txt b/src/HYDRO_tests/reference_data/CMakeLists.txt index 14e651d8..d7d2238f 100644 --- a/src/HYDRO_tests/reference_data/CMakeLists.txt +++ b/src/HYDRO_tests/reference_data/CMakeLists.txt @@ -146,6 +146,7 @@ SET(REFERENCE_DATA bathy_text_labels.png bathy_prs_fit_selected.png zone_random_colors.png + diff_image.png ) # Application tests diff --git a/src/HYDRO_tests/reference_data/linux/diff_image.png b/src/HYDRO_tests/reference_data/linux/diff_image.png new file mode 100644 index 00000000..f20ddb7f Binary files /dev/null and b/src/HYDRO_tests/reference_data/linux/diff_image.png differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/CLC06-cut_1_res.png b/src/HYDRO_tests/reference_data/linux/hydro/CLC06-cut_1_res.png deleted file mode 100644 index 6c1f2ed4..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/CLC06-cut_1_res.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/CLC06-cut_1_res_1.png b/src/HYDRO_tests/reference_data/linux/hydro/CLC06-cut_1_res_1.png deleted file mode 100644 index 8f43edbc..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/CLC06-cut_1_res_1.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/CLC06-cut_1_res_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/CLC06-cut_1_res_diff.png deleted file mode 100644 index 314bea80..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/CLC06-cut_1_res_diff.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_Channel.png b/src/HYDRO_tests/reference_data/linux/hydro/Extraction_Channel.png deleted file mode 100644 index 93abf401..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_Channel.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_Channel_1.png b/src/HYDRO_tests/reference_data/linux/hydro/Extraction_Channel_1.png deleted file mode 100644 index a9e5c6ab..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_Channel_1.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_Channel_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/Extraction_Channel_diff.png deleted file mode 100644 index 11419072..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_Channel_diff.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_ImmZone.png b/src/HYDRO_tests/reference_data/linux/hydro/Extraction_ImmZone.png deleted file mode 100644 index 9facc991..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_ImmZone.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_ImmZone_1.png b/src/HYDRO_tests/reference_data/linux/hydro/Extraction_ImmZone_1.png deleted file mode 100644 index 3d9a2790..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_ImmZone_1.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_ImmZone_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/Extraction_ImmZone_diff.png deleted file mode 100644 index 8d301474..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Extraction_ImmZone_diff.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_Split_Polyline.png b/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_Split_Polyline.png deleted file mode 100644 index 2046ed91..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_Split_Polyline.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_Split_Polyline_1.png b/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_Split_Polyline_1.png deleted file mode 100644 index 93db9e58..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_Split_Polyline_1.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_Split_Polyline_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_Split_Polyline_diff.png deleted file mode 100644 index fdfd0dd1..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_Split_Polyline_diff.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_TransparentPrs.png b/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_TransparentPrs.png deleted file mode 100644 index 18897106..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_TransparentPrs.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_TransparentPrs_1.png b/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_TransparentPrs_1.png deleted file mode 100644 index 52a22cc7..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_TransparentPrs_1.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_TransparentPrs_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_TransparentPrs_diff.png deleted file mode 100644 index 888b2a0f..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/LandCoverMap_TransparentPrs_diff.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Merge_Polylines.png b/src/HYDRO_tests/reference_data/linux/hydro/Merge_Polylines.png deleted file mode 100644 index d7f8ba31..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Merge_Polylines.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Merge_Polylines_1.png b/src/HYDRO_tests/reference_data/linux/hydro/Merge_Polylines_1.png deleted file mode 100644 index c90a95d5..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Merge_Polylines_1.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Merge_Polylines_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/Merge_Polylines_diff.png deleted file mode 100644 index fe572e52..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Merge_Polylines_diff.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/NLD_water_areas_dcw.png b/src/HYDRO_tests/reference_data/linux/hydro/NLD_water_areas_dcw.png deleted file mode 100644 index 907b2c70..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/NLD_water_areas_dcw.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/NLD_water_areas_dcw_1.png b/src/HYDRO_tests/reference_data/linux/hydro/NLD_water_areas_dcw_1.png deleted file mode 100644 index b548c8c2..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/NLD_water_areas_dcw_1.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/NLD_water_areas_dcw_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/NLD_water_areas_dcw_diff.png deleted file mode 100644 index 1e157380..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/NLD_water_areas_dcw_diff.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Polyline_Presentation.png b/src/HYDRO_tests/reference_data/linux/hydro/Polyline_Presentation.png deleted file mode 100644 index 8280feca..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Polyline_Presentation.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Polyline_Presentation_1.png b/src/HYDRO_tests/reference_data/linux/hydro/Polyline_Presentation_1.png deleted file mode 100644 index e5275ac7..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Polyline_Presentation_1.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Polyline_Presentation_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/Polyline_Presentation_diff.png deleted file mode 100644 index cfe5d656..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Polyline_Presentation_diff.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Split_Polylines_Colors.png b/src/HYDRO_tests/reference_data/linux/hydro/Split_Polylines_Colors.png deleted file mode 100644 index 42b1f507..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Split_Polylines_Colors.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Split_Polylines_Colors_1.png b/src/HYDRO_tests/reference_data/linux/hydro/Split_Polylines_Colors_1.png deleted file mode 100644 index b96b1d93..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Split_Polylines_Colors_1.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/Split_Polylines_Colors_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/Split_Polylines_Colors_diff.png deleted file mode 100644 index 9bb37297..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/Split_Polylines_Colors_diff.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/cc_int_w_3.png b/src/HYDRO_tests/reference_data/linux/hydro/cc_int_w_3.png deleted file mode 100644 index 368185a0..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/cc_int_w_3.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/cc_int_w_3_1.png b/src/HYDRO_tests/reference_data/linux/hydro/cc_int_w_3_1.png deleted file mode 100644 index bd03835b..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/cc_int_w_3_1.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/cc_int_w_3_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/cc_int_w_3_diff.png deleted file mode 100644 index 20fefe6e..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/cc_int_w_3_diff.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/clc_dec_150_350.png b/src/HYDRO_tests/reference_data/linux/hydro/clc_dec_150_350.png deleted file mode 100644 index 8b3bcab6..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/clc_dec_150_350.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/clc_dec_150_350_1.png b/src/HYDRO_tests/reference_data/linux/hydro/clc_dec_150_350_1.png deleted file mode 100644 index 5b8d679c..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/clc_dec_150_350_1.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/clc_dec_150_350_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/clc_dec_150_350_diff.png deleted file mode 100644 index c5d6a45c..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/clc_dec_150_350_diff.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/cyprus_natural_all.png b/src/HYDRO_tests/reference_data/linux/hydro/cyprus_natural_all.png deleted file mode 100644 index a1bb0c22..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/cyprus_natural_all.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/cyprus_natural_all_1.png b/src/HYDRO_tests/reference_data/linux/hydro/cyprus_natural_all_1.png deleted file mode 100644 index eca9f5f4..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/cyprus_natural_all_1.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/cyprus_natural_all_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/cyprus_natural_all_diff.png deleted file mode 100644 index 86a92727..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/cyprus_natural_all_diff.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_empty.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_empty.png deleted file mode 100644 index 491394ca..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_empty.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_empty_1.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_empty_1.png deleted file mode 100644 index 1e37efd6..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_empty_1.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_empty_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_empty_diff.png deleted file mode 100644 index 029ff75d..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_empty_diff.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_prs.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_prs.png deleted file mode 100644 index 1a5ea8c6..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_prs.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_prs_1.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_prs_1.png deleted file mode 100644 index c2b37cf1..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_prs_1.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_prs_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_prs_diff.png deleted file mode 100644 index 84904bcd..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_prs_diff.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_selection.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_selection.png deleted file mode 100644 index 287adbfb..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_selection.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_selection_1.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_selection_1.png deleted file mode 100644 index 417780e6..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_selection_1.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_selection_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_selection_diff.png deleted file mode 100644 index b304fe59..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_selection_diff.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_zoomed_1.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_zoomed_1.png deleted file mode 100644 index 1c2106af..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_zoomed_1.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_zoomed_1_1.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_zoomed_1_1.png deleted file mode 100644 index 2944ba53..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_zoomed_1_1.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/overview_zoomed_1_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/overview_zoomed_1_diff.png deleted file mode 100644 index 30c5fd8e..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/overview_zoomed_1_diff.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/profiles_dlg_presentation.png b/src/HYDRO_tests/reference_data/linux/hydro/profiles_dlg_presentation.png deleted file mode 100644 index 1e2851aa..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/profiles_dlg_presentation.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/profiles_dlg_presentation_1.png b/src/HYDRO_tests/reference_data/linux/hydro/profiles_dlg_presentation_1.png deleted file mode 100644 index f5483cf6..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/profiles_dlg_presentation_1.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/profiles_dlg_presentation_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/profiles_dlg_presentation_diff.png deleted file mode 100644 index 3d1e01a0..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/profiles_dlg_presentation_diff.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/rebuild_cmp_out.png b/src/HYDRO_tests/reference_data/linux/hydro/rebuild_cmp_out.png deleted file mode 100644 index 504e2cf1..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/rebuild_cmp_out.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/rebuild_cmp_out_1.png b/src/HYDRO_tests/reference_data/linux/hydro/rebuild_cmp_out_1.png deleted file mode 100644 index b0362051..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/rebuild_cmp_out_1.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/rebuild_cmp_out_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/rebuild_cmp_out_diff.png deleted file mode 100644 index 0aa4e2b4..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/rebuild_cmp_out_diff.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/stream_dtm_2d.png b/src/HYDRO_tests/reference_data/linux/hydro/stream_dtm_2d.png deleted file mode 100644 index 13a7187e..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/stream_dtm_2d.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/stream_dtm_2d_1.png b/src/HYDRO_tests/reference_data/linux/hydro/stream_dtm_2d_1.png deleted file mode 100644 index ea1c4d38..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/stream_dtm_2d_1.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/linux/hydro/stream_dtm_2d_diff.png b/src/HYDRO_tests/reference_data/linux/hydro/stream_dtm_2d_diff.png deleted file mode 100644 index ab925f19..00000000 Binary files a/src/HYDRO_tests/reference_data/linux/hydro/stream_dtm_2d_diff.png and /dev/null differ diff --git a/src/HYDRO_tests/reference_data/win32/diff_image.png b/src/HYDRO_tests/reference_data/win32/diff_image.png new file mode 100644 index 00000000..f20ddb7f Binary files /dev/null and b/src/HYDRO_tests/reference_data/win32/diff_image.png differ diff --git a/src/HYDRO_tests/test_HYDROData_Image.cxx b/src/HYDRO_tests/test_HYDROData_Image.cxx index ddeeeb87..4ab09f26 100644 --- a/src/HYDRO_tests/test_HYDROData_Image.cxx +++ b/src/HYDRO_tests/test_HYDROData_Image.cxx @@ -20,7 +20,11 @@ #include #include +#include #include +#include + +extern QString REF_DATA_PATH; static QImage TestImage() { QImage aPic(50, 40, QImage::Format_RGB32); @@ -164,3 +168,13 @@ void test_HYDROData_Image::testCopy() aDoc->Close(); } + +void test_HYDROData_Image::testDiff() +{ + QImage im1, im2; + im1.load( REF_DATA_PATH + "/LandCover_Triangles.png" ); + im2.load( REF_DATA_PATH + "/LandCover_Triangles_Split.png" ); + + QImage im3 = TestViewer::diff( im1, im2 ); + CPPUNIT_ASSERT_IMAGES3( &im3, "diff_image", false ); +} diff --git a/src/HYDRO_tests/test_HYDROData_Image.h b/src/HYDRO_tests/test_HYDROData_Image.h index c649ece7..36001373 100644 --- a/src/HYDRO_tests/test_HYDROData_Image.h +++ b/src/HYDRO_tests/test_HYDROData_Image.h @@ -24,6 +24,7 @@ class test_HYDROData_Image : public CppUnit::TestFixture { CPPUNIT_TEST(testTrsf); CPPUNIT_TEST(testReferences); CPPUNIT_TEST(testCopy); + CPPUNIT_TEST(testDiff); CPPUNIT_TEST_SUITE_END(); private: @@ -45,6 +46,7 @@ public: // checks the image properties copy/paste void testCopy(); + void testDiff(); }; CPPUNIT_TEST_SUITE_REGISTRATION(test_HYDROData_Image);