2013-06-19 13:04:52 +08:00
|
|
|
% Matlab binding test cases
|
|
|
|
% Uses Matlab's builtin testing framework
|
|
|
|
classdef OpenCVTest < matlab.unittest.TestCase
|
|
|
|
|
|
|
|
methods(Test)
|
|
|
|
|
|
|
|
% check if the autogenerated functions can be found
|
2013-06-19 14:37:57 +08:00
|
|
|
function functionsExist(testcase)
|
2013-06-19 13:04:52 +08:00
|
|
|
try
|
|
|
|
cv.rand();
|
|
|
|
catch
|
|
|
|
testcase.verifyFail();
|
|
|
|
end
|
|
|
|
testcase.verifyTrue(true);
|
|
|
|
end
|
2013-06-19 14:37:57 +08:00
|
|
|
|
|
|
|
% check that std exception is thrown
|
|
|
|
function stdException(testcase)
|
|
|
|
try
|
|
|
|
std_exception();
|
|
|
|
testcase.verifyFail();
|
|
|
|
catch
|
|
|
|
% TODO: Catch more specific exception
|
|
|
|
testcase.verifyTrue(true);
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
% check that OpenCV exceptions are correctly caught
|
|
|
|
function cvException(testcase)
|
|
|
|
testcase.verifyFail();
|
|
|
|
end
|
|
|
|
|
|
|
|
% check that all exceptions are caught
|
|
|
|
function allException(testcase)
|
|
|
|
try
|
|
|
|
exception();
|
|
|
|
testcase.verifyFail();
|
|
|
|
catch
|
|
|
|
% TODO: Catch more specific exception
|
|
|
|
testcase.verifyTrue(true);
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-06-19 13:04:52 +08:00
|
|
|
end
|
|
|
|
end
|