From cc2894689083d090479451596cbda8a8434e6f6a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Fri, 29 Mar 2024 16:36:53 +0100
Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Testsuite:=20fix=20AIM=20tests?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The test condition was incorrect (though this was probably harmless).

Also the error message related to oo_.dr.ghu was incorrect.
---
 tests/AIM/fs2000_b1L1L_AIM.mod   | 8 ++++----
 tests/AIM/fs2000x10L9_L_AIM.mod  | 8 ++++----
 tests/AIM/fs2000x10_L9_L_AIM.mod | 8 ++++----
 tests/AIM/ls2003_2L0L_AIM.mod    | 8 ++++----
 tests/AIM/ls2003_2L2L_AIM.mod    | 9 ++++-----
 5 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/tests/AIM/fs2000_b1L1L_AIM.mod b/tests/AIM/fs2000_b1L1L_AIM.mod
index ffd5d5bb07..eae3075983 100644
--- a/tests/AIM/fs2000_b1L1L_AIM.mod
+++ b/tests/AIM/fs2000_b1L1L_AIM.mod
@@ -95,8 +95,8 @@ stoch_simul(aim_solver, order=1, irf=0);
 benchmark = load(['fs2000_b1L1L' filesep 'Output' filesep 'fs2000_b1L1L_results']);
 threshold = 1e-8;
  
-if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx) > threshold));
+if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx))) > threshold
   error('error in ghx');
-elseif max(max(abs(benchmark.oo_.dr.ghu-oo_.dr.ghu) > threshold));
-  error('error in ghy');
-end;
+elseif max(max(abs(benchmark.oo_.dr.ghu-oo_.dr.ghu))) > threshold
+  error('error in ghu');
+end
diff --git a/tests/AIM/fs2000x10L9_L_AIM.mod b/tests/AIM/fs2000x10L9_L_AIM.mod
index e52b2db37d..ed70ce04bb 100644
--- a/tests/AIM/fs2000x10L9_L_AIM.mod
+++ b/tests/AIM/fs2000x10L9_L_AIM.mod
@@ -79,8 +79,8 @@ stoch_simul(aim_solver, order=1,irf=0);
 benchmark = load(['fs2000x10L9_L' filesep 'Output' filesep 'fs2000x10L9_L_results']);
 threshold = 1e-8;
  
-if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx) > threshold));
+if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx))) > threshold
   error('error in ghx');
-elseif max(max(abs(benchmark.oo_.dr.ghu-oo_.dr.ghu) > threshold));
-  error('error in ghy');
-end;
+elseif max(max(abs(benchmark.oo_.dr.ghu-oo_.dr.ghu))) > threshold
+  error('error in ghu');
+end
diff --git a/tests/AIM/fs2000x10_L9_L_AIM.mod b/tests/AIM/fs2000x10_L9_L_AIM.mod
index 92c5c2179b..012fc52487 100644
--- a/tests/AIM/fs2000x10_L9_L_AIM.mod
+++ b/tests/AIM/fs2000x10_L9_L_AIM.mod
@@ -60,8 +60,8 @@ stoch_simul(aim_solver, order=1,irf=0);
 benchmark = load(['fs2000x10_L9_L' filesep 'Output' filesep 'fs2000x10_L9_L_results']);
 threshold = 1e-8;
  
-if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx) > threshold));
+if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx))) > threshold
   error('error in ghx');
-elseif max(max(abs(benchmark.oo_.dr.ghu-oo_.dr.ghu) > threshold));
-  error('error in ghy');
-end;
+elseif max(max(abs(benchmark.oo_.dr.ghu-oo_.dr.ghu))) > threshold
+  error('error in ghu');
+end
diff --git a/tests/AIM/ls2003_2L0L_AIM.mod b/tests/AIM/ls2003_2L0L_AIM.mod
index 175b852426..1a9d54152a 100644
--- a/tests/AIM/ls2003_2L0L_AIM.mod
+++ b/tests/AIM/ls2003_2L0L_AIM.mod
@@ -48,8 +48,8 @@ stoch_simul(aim_solver, order=1,irf=0);
 benchmark = load(['ls2003_2L0L' filesep 'Output' filesep 'ls2003_2L0L_results']);
 threshold = 1e-8;
  
-if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx) > threshold));
+if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx))) > threshold
   error('error in ghx');
-elseif max(max(abs(benchmark.oo_.dr.ghu-oo_.dr.ghu) > threshold));
-  error('error in ghy');
-end;
+elseif max(max(abs(benchmark.oo_.dr.ghu-oo_.dr.ghu))) > threshold
+  error('error in ghu');
+end
diff --git a/tests/AIM/ls2003_2L2L_AIM.mod b/tests/AIM/ls2003_2L2L_AIM.mod
index 0fcef43fff..12e53c3062 100644
--- a/tests/AIM/ls2003_2L2L_AIM.mod
+++ b/tests/AIM/ls2003_2L2L_AIM.mod
@@ -46,9 +46,8 @@ stoch_simul(aim_solver, order=1,irf=0);
 benchmark = load(['ls2003_2L2L' filesep 'Output' filesep 'ls2003_2L2L_results']);
 threshold = 1e-8;
  
-if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx) > threshold));
+if max(max(abs(benchmark.oo_.dr.ghx-oo_.dr.ghx))) > threshold
   error('error in ghx');
-elseif max(max(abs(benchmark.oo_.dr.ghu-oo_.dr.ghu) > threshold));
-  error('error in ghy');
-end;
-
+elseif max(max(abs(benchmark.oo_.dr.ghu-oo_.dr.ghu))) > threshold
+  error('error in ghu');
+end
-- 
GitLab