From cdd85f32a7d5c14ea0dfd221fe20cf7b349985c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Ry=C3=BBk=29?=
 <stepan@adjemian.eu>
Date: Fri, 25 Mar 2022 19:36:50 +0100
Subject: [PATCH] Update unit tests for trust region routines.

---
 tests/nonlinearsolvers.m | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/nonlinearsolvers.m b/tests/nonlinearsolvers.m
index 8c4cfc1e68..1003702d1e 100644
--- a/tests/nonlinearsolvers.m
+++ b/tests/nonlinearsolvers.m
@@ -50,7 +50,6 @@ objfun = { @rosenbrock,
            @broydenbanded };
 
 % FIXME block_trust_region (mex) or trust_region (matlab) do not work for all n (not sure we can fix that).
-% FIXME block_trust_region (mex) and trust_region (matlab) do not behave the same (spurious convergence for powell2 and trigonometric with block_trust_region).
 
 %
 % Test mex routine
@@ -82,6 +81,14 @@ for i=1:length(objfun)
                     dprintf('Nonlinear solver is expected to fail on %s function but did not return an error.', func2str(objfun{i}))
                 end
             end
+        elseif isequal(func2str(objfun{i}), 'trigonometric')
+            % FIXME block_trust_region (mex) fails, with exit code equal to 4, but not trust_region (matlab). Would be nice to undertsand the difference. 
+            if ~errorflag
+                testFailed = testFailed+1;
+                if debug
+                    dprintf('Nonlinear solver is expected to fail on %s function but did not return an error.', func2str(objfun{i}))
+                end
+            end
         else
             if errorflag || norm(objfun{i}(x))>tolf
                 testFailed = testFailed+1;
-- 
GitLab