Commit 7f1aa1b9 authored by Alexey Spizhevoy's avatar Alexey Spizhevoy

removed catch from GPU stereo_bp test as --gtest_catch_exceptions flags exists…

removed catch from GPU stereo_bp test as --gtest_catch_exceptions flags exists (but err msg isn't printed in case when there is no GPU)
parent 51cee841
#include "test_precomp.hpp" #include "test_precomp.hpp"
// Run test with --gtest_catch_exceptions flag to avoid runtime errors in
// the case when there is no GPU
CV_TEST_MAIN("gpu") CV_TEST_MAIN("gpu")
// TODO Add other tests from tests/gpu folder
// TODO When there is no GPU test system doesn't print error message: it fails or keeps
// quiet when --gtest_catch_exceptions is enabled
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
struct CV_GpuStereoBPTest : public cvtest::BaseTest struct CV_GpuStereoBPTest : public cvtest::BaseTest
{ {
void run(int ) void run(int)
{ {
cv::Mat img_l = cv::imread(std::string(ts->get_data_path()) + "stereobp/aloe-L.png"); cv::Mat img_l = cv::imread(std::string(ts->get_data_path()) + "stereobp/aloe-L.png");
cv::Mat img_r = cv::imread(std::string(ts->get_data_path()) + "stereobp/aloe-R.png"); cv::Mat img_r = cv::imread(std::string(ts->get_data_path()) + "stereobp/aloe-R.png");
...@@ -55,13 +55,11 @@ struct CV_GpuStereoBPTest : public cvtest::BaseTest ...@@ -55,13 +55,11 @@ struct CV_GpuStereoBPTest : public cvtest::BaseTest
return; return;
} }
try
{
{cv::Mat temp; cv::cvtColor(img_l, temp, CV_BGR2BGRA); cv::swap(temp, img_l);} {cv::Mat temp; cv::cvtColor(img_l, temp, CV_BGR2BGRA); cv::swap(temp, img_l);}
{cv::Mat temp; cv::cvtColor(img_r, temp, CV_BGR2BGRA); cv::swap(temp, img_r);} {cv::Mat temp; cv::cvtColor(img_r, temp, CV_BGR2BGRA); cv::swap(temp, img_r);}
cv::gpu::GpuMat disp;
cv::gpu::StereoBeliefPropagation bpm(64, 8, 2, 25, 0.1f, 15, 1, CV_16S); cv::gpu::StereoBeliefPropagation bpm(64, 8, 2, 25, 0.1f, 15, 1, CV_16S);
cv::gpu::GpuMat disp;
bpm(cv::gpu::GpuMat(img_l), cv::gpu::GpuMat(img_r), disp); bpm(cv::gpu::GpuMat(img_l), cv::gpu::GpuMat(img_r), disp);
...@@ -76,13 +74,6 @@ struct CV_GpuStereoBPTest : public cvtest::BaseTest ...@@ -76,13 +74,6 @@ struct CV_GpuStereoBPTest : public cvtest::BaseTest
ts->set_failed_test_info(cvtest::TS::FAIL_GENERIC); ts->set_failed_test_info(cvtest::TS::FAIL_GENERIC);
return; return;
} }
}
catch(const cv::Exception& e)
{
if (!check_and_treat_gpu_exception(e, ts))
throw;
return;
}
ts->set_failed_test_info(cvtest::TS::OK); ts->set_failed_test_info(cvtest::TS::OK);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment