From 8daed40ab39d9a4ca01d280158539864a0197037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Thu, 27 Mar 2014 18:18:29 +0100 Subject: [PATCH] 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(). --- matlab/utilities/tests/mtest.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/matlab/utilities/tests/mtest.m b/matlab/utilities/tests/mtest.m index ae8739ef2..29f771613 100644 --- a/matlab/utilities/tests/mtest.m +++ b/matlab/utilities/tests/mtest.m @@ -78,11 +78,12 @@ for i=1:nn fprintf(tid,str); end fprintf(tid,['LOG = NaN;\n']); - fprintf(tid,'catch\n'); - fprintf(tid,'exception = lasterror;\n'); if isoctave + fprintf(tid,'catch\n'); + fprintf(tid,'exception = lasterror;\n'); fprintf(tid, 'LOG = ''%s'';\n','The Log output is not available with Octave!'); else + fprintf(tid,'catch exception\n'); fprintf(tid,['LOG = getReport(exception,''extended'');\n']); end fprintf(tid,['T = NaN;\n']);