From 040c4f11a7d00280b409cc34d85d6e9dbe86c9cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Tue, 16 Apr 2019 12:22:41 +0200
Subject: [PATCH] Dynare++: ensure that testsuite does not fail because of
 safety check

Safety check introduced in c10d8daf9.

Ref #217
---
 dynare++/tl/testing/tests.cc | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/dynare++/tl/testing/tests.cc b/dynare++/tl/testing/tests.cc
index a5774f39a7..9beb7cf69c 100644
--- a/dynare++/tl/testing/tests.cc
+++ b/dynare++/tl/testing/tests.cc
@@ -1106,15 +1106,11 @@ main()
   all_tests.push_back(std::make_unique<UnfoldZContSmall>());
   all_tests.push_back(std::make_unique<UnfoldZCont>());
 
-  // find maximum dimension and maximum nvar
-  int dmax = 0;
-  int nvmax = 0;
+  /* Initialize library. We do it for each test individually instead of
+     computing the maximum dimension and number of variables, because otherwise it
+     does not pass the check on maximum problem size. */
   for (const auto &test : all_tests)
-    {
-      dmax = std::max(dmax, test->dim);
-      nvmax = std::max(nvmax, test->nvar);
-    }
-  TLStatic::init(dmax, nvmax); // initialize library
+    TLStatic::init(test->dim, test->nvar);
 
   // launch the tests
   int success = 0;
-- 
GitLab