function test_suite = testLot
initTestSuite;

function testLotILot
% Tests for perfect reconstruction, i.e. applying the forward and inverse
% transform with the same arguments produces the initial input.

in = randn(100,1);

% Default parameters and fixed window length
assertVectorsAlmostEqual(in, ilot(lot(in,20),20));

% Default parameters and variable window length
assertVectorsAlmostEqual(in, ilot(lot(in,[20 50 30]),[20 50 30]));

% Different local transforms
assertVectorsAlmostEqual(in, ilot(lot(in,20,'fft'),20,'fft'));
assertVectorsAlmostEqual(in, ilot(lot(in,20,'id'),20,'id'));

% Different tail lengths
assertVectorsAlmostEqual(in, ilot(lot(in,25,'mdct',0),25,'mdct',0));
assertVectorsAlmostEqual(in, ilot(lot(in,25,'mdct',6),25,'mdct',6));
assertVectorsAlmostEqual(in, ilot(lot(in,25,'mdct',12),25,'mdct',12));

% Different tail functions
assertVectorsAlmostEqual(in, ilot(lot(in,20,[],[],'sin4'),20,[],[],'sin'));
assertVectorsAlmostEqual(in, ilot(lot(in,20,[],[],'sin4'),20,[],[],'sin8'));
