From: Vadim Pisarevsky Date: Fri, 27 Apr 2012 12:07:56 +0000 (+0000) Subject: added test to check #1737 X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~1314^2~1977 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d60caea5590109f4716fd2d0db7276cbe99c5734;p=platform%2Fupstream%2Fopencv.git added test to check #1737 --- diff --git a/modules/highgui/test/test_ffmpeg.cpp b/modules/highgui/test/test_ffmpeg.cpp index 6de2960..518ff79 100644 --- a/modules/highgui/test/test_ffmpeg.cpp +++ b/modules/highgui/test/test_ffmpeg.cpp @@ -142,6 +142,35 @@ public: } }; -TEST(Highgui_Video, ffmpeg_writebig) { CV_FFmpegWriteBigVideoTest test; test.safe_run(); } +TEST(Highgui_Video, ffmpeg_writebig) { CV_FFmpegWriteBigVideoTest test; test.safe_run(); } + +class CV_FFmpegReadImageTest : public cvtest::BaseTest +{ +public: + void run(int) + { + try + { + string filename = ts->get_data_path() + "../cv/features2d/tsukuba.png"; + VideoCapture cap(filename); + Mat img0 = imread(filename, 1); + Mat img, img_next; + cap >> img; + cap >> img_next; + + CV_Assert( !img0.empty() && !img.empty() && img_next.empty() ); + + double diff = norm(img0, img, CV_C); + CV_Assert( diff == 0 ); + } + catch(...) + { + ts->set_failed_test_info(ts->FAIL_INVALID_OUTPUT); + } + ts->set_failed_test_info(cvtest::TS::OK); + } +}; + +TEST(Highgui_Video, ffmpeg_image) { CV_FFmpegReadImageTest test; test.safe_run(); } #endif