Rank: 435043 based on 0 downloads (last 30 days) and 0 file submitted
photo

Nick

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by Nick View all
Updated File Comments Rating
03 Aug 2009 MATLAB xUnit Test Framework MATLAB xUnit is a unit test framework for MATLAB code. Author: Steve Eddins

If you are putting multiple tests in a single file, don't start any function names with "setup". The following code fails. Remove setup and it works.

function test_suite = testFliplr
initTestSuite;
end

function testFliplrMatrix
in = magic(3);
assertEqual(fliplr(in), in(:, [3 2 1]));
end

function testFliplrVector
assertEqual(fliplr([1 4 10]), [10 4 1]);
end

function test3
[a b] = setupdata;
assertEqual(a,1);
assertEqual(b,2);
end

function [a b] = setupdata
a = 1;
b = 2;
end

22 Jul 2009 MATLAB xUnit Test Framework MATLAB xUnit is a unit test framework for MATLAB code. Author: Steve Eddins

I think there is a divide by inf in computing the relative tolerance. Using the 'absolute' flag provides the correct result.

22 Jul 2009 MATLAB xUnit Test Framework MATLAB xUnit is a unit test framework for MATLAB code. Author: Steve Eddins

Great software! Thanks. I noticed a bug:

function testStuff
assertElementsAlmostEqual(0,Inf)
assertVectorsAlmostEqual(0,Inf)
end

Will not flag a failure.

--N

Contact us