-
Notifications
You must be signed in to change notification settings - Fork 0
/
saveQCim_deepMLASTTest.m
41 lines (37 loc) · 1.4 KB
/
saveQCim_deepMLASTTest.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
% test saveQCim_deepMLAST
function tests = saveQCim_deepMLASTTest
tests = functiontests(localfunctions);
end
% Input checks
function testInvalidDir(testCase)
saveFileName = 'M1';
rawIm = zeros([256,256,100]);
labelIm = zeros([256,256,100]);
expErr = 'saveQCim_deepMLAST:InvalidDirectory';
verifyError(testCase,@() saveQCim_deepMLAST(0,saveFileName,rawIm,labelIm),expErr);
verifyError(testCase,@() saveQCim_deepMLAST('E:/Fake',saveFileName,rawIm,labelIm),expErr);
end
function testInvalidSaveName(testCase)
dirName = 'UnitTesting/Empty';
rawIm = zeros([256,256,100]);
labelIm = zeros([256,256,100]);
expErr = 'saveQCim_deepMLAST:InvalidSaveName';
verifyError(testCase,@() saveQCim_deepMLAST(dirName,0,rawIm,labelIm),expErr);
end
function testInvalidImages(testCase)
saveFileName = 'M1';
dirName = 'UnitTesting/Empty';
rawIm = zeros([256,256,100]);
labelIm = zeros([256,256,100]);
expErr = 'saveQCim_deepMLAST:InvalidInput';
verifyError(testCase,@() saveQCim_deepMLAST(dirName,saveFileName,0,labelIm),expErr);
verifyError(testCase,@() saveQCim_deepMLAST(dirName,saveFileName,rawIm,0),expErr);
end
function testMismatchedImages(testCase)
saveFileName = 'M1';
dirName = 'UnitTesting/Empty';
rawIm = zeros([128,128,100]);
labelIm = zeros([256,256,100]);
expErr = 'saveQCim_deepMLAST:DimensionMismatch';
verifyError(testCase,@() saveQCim_deepMLAST(dirName,saveFileName,rawIm,labelIm),expErr);
end