% This is a simple testset collectable!
function out = StestTestSet01(in)
out = str2func(in);
% ------------------------ LOCAL FUNCTIONS ------------------------
% =================================================================
function [tu,status,tdata] = MUnitTest_Sin(tu,tdata)
% Check the function 'sin'
% Init the status:
status = true;
% A list of asserts:
try
% A set of points:
assertTrue(tu,sin(0)==0,'Sin(0) isn''t 0!');
assertTrue(tu,sin(pi/2)==1,'Sin(pi/2) isn''t 1!');
assertTrue(tu,sin(-pi/2)==-1,'Sin(-pi/2) isn''t -1!');
% Type check:
assertTrue(tu, ...
strcmp(class(sin(double(1))),'double'), ...
'Sin of a double number returns a non-double number!');
assertFalse(tu, ...
strcmp(class(sin(single(1))),'double'), ...
'Sin of a SINGLE number returns a double number!');
catch
% Bad!!!
status = false;
end
% -----------------------------------------------------------------
function [tu,status,tdata] = MUnitTest_Cos(tu,tdata)
% Check the function 'cos'
% Init the status:
status = true;
% A list of asserts:
try
% A set of points:
assertTrue(tu,cos(0)==1,'Cos(0) isn''t 1!');
assertTrue(tu,cos(pi/2)==0,'Cos(pi/2) isn''t 0!');
assertTrue(tu,cos(-pi/2)==0,'Cos(-pi/2) isn''t 0!');
% Type check:
assertTrue(tu, ...
strcmp(class(cos(double(1))),'double'), ...
'Cos of a double number returns a non-double number!');
assertFalse(tu, ...
strcmp(class(cos(single(1))),'double'), ...
'Cos of a SINGLE number returns a double number!');
catch
% Bad!!!
status = false;
end
% -----------------------------------------------------------------