Fix exception handling under MATLAB in unitary test infrastructure.

The getReport() function of MATLAB expects an exception coming from the "catch"
statement. It is not happy with the value returned by lasterror().
time-shift
Sébastien Villemot 2014-03-27 18:18:29 +01:00
parent f0f355e9b5
commit 8daed40ab3
1 changed files with 3 additions and 2 deletions

View File

@ -78,11 +78,12 @@ for i=1:nn
fprintf(tid,str); fprintf(tid,str);
end end
fprintf(tid,['LOG = NaN;\n']); fprintf(tid,['LOG = NaN;\n']);
fprintf(tid,'catch\n');
fprintf(tid,'exception = lasterror;\n');
if isoctave if isoctave
fprintf(tid,'catch\n');
fprintf(tid,'exception = lasterror;\n');
fprintf(tid, 'LOG = ''%s'';\n','The Log output is not available with Octave!'); fprintf(tid, 'LOG = ''%s'';\n','The Log output is not available with Octave!');
else else
fprintf(tid,'catch exception\n');
fprintf(tid,['LOG = getReport(exception,''extended'');\n']); fprintf(tid,['LOG = getReport(exception,''extended'');\n']);
end end
fprintf(tid,['T = NaN;\n']); fprintf(tid,['T = NaN;\n']);