Unverified Commit 8acdb9f7 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Testsuite: MATLAB R2014a compatibility fixes

parent e7162a2a
......@@ -25,10 +25,10 @@ end;
initval_file(series = ds);
if oo_.initval_series.dates(1) ~= dates('1Y');
error("Wrong initial date in oo_.initval_series");
error('Wrong initial date in oo_.initval_series');
end;
if oo_.initval_series{'x'}.data(6) ~= 0.9;
error("Wrond value for x");
error('Wrong value for x');
end;
perfect_foresight_setup(periods=200);
......@@ -49,10 +49,10 @@ ds1 = dseries(data1, '1Y', {'c', 'cmav', 'k', 'z_backward', 'z_forward', 'x'});
initval_file(series = ds1, first_obs = 3, last_obs = 210, nobs = 208);
if oo_.initval_series.dates(1) ~= dates('3Y');
error("Wrong initial date in oo_.initval_series");
error('Wrong initial date in oo_.initval_series');
end;
if oo_.initval_series{'x'}.data(6) ~= 0.9;
error("Wrond value for x");
error('Wrong value for x');
end;
......@@ -70,10 +70,10 @@ end
initval_file(series = ds1, first_obs = 3Y, last_obs = 210Y, nobs = 208);
if oo_.initval_series.dates(1) ~= dates('3Y');
error("Wrong initial date in oo_.initval_series");
error('Wrong initial date in oo_.initval_series');
end;
if oo_.initval_series{'x'}.data(6) ~= 0.9;
error("Wrond value for x");
error('Wrong value for x');
end;
......@@ -91,10 +91,10 @@ end
initval_file(series = ds1, first_simulation_period = 7);
if oo_.initval_series.dates(1) ~= dates('3Y');
error("Wrong initial date in oo_.initval_series");
error('Wrong initial date in oo_.initval_series');
end;
if oo_.initval_series{'x'}.data(6) ~= 0.9;
error("Wrond value for x");
error('Wrong value for x');
end;
......@@ -112,10 +112,10 @@ end
initval_file(series = ds1, first_simulation_period = 7Y);
if oo_.initval_series.dates(1) ~= dates('3Y');
error("Wrong initial date in oo_.initval_series");
error('Wrong initial date in oo_.initval_series');
end;
if oo_.initval_series{'x'}.data(6) ~= 0.9;
error("Wrond value for x");
error('Wrong value for x');
end;
......
......@@ -179,7 +179,7 @@ for i = 1:size(x,1)
end
fclose(fh);
if ~verLessThan('matlab', '8.2')
if (ispc && ~matlab_ver_less_than('8.2')) || (~ispc && ~matlab_ver_less_than('9.0'))
writetable(table(x,y), 'data.xlsx')
options = struct();
options.datafile = 'data.xlsx';
......@@ -189,18 +189,18 @@ if ~verLessThan('matlab', '8.2')
failed_tests = my_assert(failed_tests, series.nobs == 10, ...
'*.xlsx file nobs test');
num_tests = num_tests + 2;
end
if ispc
writetable(table(x,y), 'data.xls')
options = struct();
options.datafile = 'data.xls';
series = histvalf_initvalf('INITVAL_FILE', M, options);
failed_tests = my_assert(failed_tests, series.init == dates('1Y'), ...
if ispc && ~matlab_ver_less_than('8.2') % Does not work under GNU/Linux with R2020b (Unicode issue in xlsread)
writetable(table(x,y), 'data.xls')
options = struct();
options.datafile = 'data.xls';
series = histvalf_initvalf('INITVAL_FILE', M, options);
failed_tests = my_assert(failed_tests, series.init == dates('1Y'), ...
'*.xls file first_obs test');
failed_tests = my_assert(failed_tests, series.nobs == 10, ...
failed_tests = my_assert(failed_tests, series.nobs == 10, ...
'*.xls file nobs test');
num_tests = num_tests + 2;
end
num_tests = num_tests + 2;
end
cd(getenv('TOP_TEST_DIR'));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment