Skip to content

Commit 5bb45ba

Browse files
committed
Merge pull request opencv#19085 from OrestChura:oc/fix_new_streaming_tests
2 parents a044797 + 79b4dc1 commit 5bb45ba

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

modules/gapi/test/streaming/gapi_streaming_tests.cpp

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,7 +1704,11 @@ TEST(GAPI_Streaming, CopyFrame)
17041704
cv::GComputation comp(cv::GIn(in), cv::GOut(out));
17051705

17061706
auto cc = comp.compileStreaming();
1707-
cc.setSource<BGRSource>(filepath);
1707+
try {
1708+
cc.setSource<BGRSource>(filepath);
1709+
} catch(...) {
1710+
throw SkipTestException("Video file can not be opened");
1711+
}
17081712

17091713
cv::VideoCapture cap;
17101714
cap.open(filepath);
@@ -1739,7 +1743,11 @@ TEST(GAPI_Streaming, Reshape)
17391743
cv::GComputation comp(cv::GIn(in), cv::GOut(out));
17401744

17411745
auto cc = comp.compileStreaming();
1742-
cc.setSource<BGRSource>(filepath);
1746+
try {
1747+
cc.setSource<BGRSource>(filepath);
1748+
} catch(...) {
1749+
throw SkipTestException("Video file can not be opened");
1750+
}
17431751

17441752
cv::VideoCapture cap;
17451753
cap.open(filepath);
@@ -1765,7 +1773,11 @@ TEST(GAPI_Streaming, Reshape)
17651773
// Reshape the graph meta
17661774
filepath = findDataFile("cv/video/1920x1080.avi");
17671775
cc.stop();
1768-
cc.setSource<BGRSource>(filepath);
1776+
try {
1777+
cc.setSource<BGRSource>(filepath);
1778+
} catch(...) {
1779+
throw SkipTestException("Video file can not be opened");
1780+
}
17691781

17701782
cap.open(filepath);
17711783
if (!cap.isOpened())
@@ -1799,7 +1811,11 @@ TEST(GAPI_Streaming, AccessBGRFromBGRFrame)
17991811
cv::GComputation comp(cv::GIn(in), cv::GOut(out));
18001812

18011813
auto cc = comp.compileStreaming();
1802-
cc.setSource<BGRSource>(filepath);
1814+
try {
1815+
cc.setSource<BGRSource>(filepath);
1816+
} catch(...) {
1817+
throw SkipTestException("Video file can not be opened");
1818+
}
18031819

18041820
cv::VideoCapture cap;
18051821
cap.open(filepath);
@@ -1831,7 +1847,11 @@ TEST(GAPI_Streaming, AccessBGRFromNV12Frame)
18311847
cv::GComputation comp(cv::GIn(in), cv::GOut(out));
18321848

18331849
auto cc = comp.compileStreaming();
1834-
cc.setSource<NV12Source>(filepath);
1850+
try {
1851+
cc.setSource<NV12Source>(filepath);
1852+
} catch(...) {
1853+
throw SkipTestException("Video file can not be opened");
1854+
}
18351855

18361856
cv::VideoCapture cap;
18371857
cap.open(filepath);

0 commit comments

Comments
 (0)