From 7e07d3e0fc5ca7b92997fffa912d530379cf5b51 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Thu, 19 Dec 2019 14:48:52 +0100
Subject: [PATCH] =?UTF-8?q?Testsuite:=20add=20further=20check=20to=20verif?=
 =?UTF-8?q?y=20that=20=E2=80=9Cinitval=5Ffile=E2=80=9D=20works=20as=20expe?=
 =?UTF-8?q?cted?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Ref. #1663
---
 tests/initval_file/ramst_initval_file.mod    | 20 +++++++++++++++++---
 tests/initval_file/ramst_initval_file_data.m |  6 +++---
 2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/tests/initval_file/ramst_initval_file.mod b/tests/initval_file/ramst_initval_file.mod
index 0d0cdabb4..2cc8f91ed 100644
--- a/tests/initval_file/ramst_initval_file.mod
+++ b/tests/initval_file/ramst_initval_file.mod
@@ -22,20 +22,34 @@ k = ((delt+bet)/(1.0*aa*alph))^(1/(alph-1));
 c = aa*k^alph-delt*k;
 end;
 
-initval_file(filename = ramst_initval_file_data_row_vec_mat);
 steady;
+
+initval_file(filename = ramst_initval_file_data_row_vec_mat);
+if oo_.exo_simul(2) ~= 1.2
+  error('initval_file problem with exogenous variable');
+end
+if oo_.endo_simul(2, 2) ~= 13
+  error('initval_file option problem with endogenous variable');
+end
 perfect_foresight_setup(periods=200);
 perfect_foresight_solver;
 
+oo_.exo_simul = [];
+oo_.endo_simul = [];
 
 initval_file(filename = ramst_initval_file_data_col_vec_mat);
-steady;
+if oo_.exo_simul(2) ~= 1.2
+  error('initval_file problem with exogenous variable');
+end
+if oo_.endo_simul(2, 2) ~= 13
+  error('initval_file problem with endogenous variable');
+end
+
 perfect_foresight_setup(periods=200);
 perfect_foresight_solver;
 
 if ispc()
     initval_file(filename = ramst_initval_file_excel);
-    steady;
     perfect_foresight_setup(periods=200);
     perfect_foresight_solver;
 end
diff --git a/tests/initval_file/ramst_initval_file_data.m b/tests/initval_file/ramst_initval_file_data.m
index 16c389781..cc1914ca1 100644
--- a/tests/initval_file/ramst_initval_file_data.m
+++ b/tests/initval_file/ramst_initval_file_data.m
@@ -1,6 +1,6 @@
 x = vertcat([ 1; 1.2 ], repmat(1, 200, 1));
-k = repmat(12.7551, 202, 1);
-c = repmat(1.53061, 202, 1);
+k = repmat(13, 202, 1);
+c = repmat(1.5, 202, 1);
 save('ramst_initval_file_data_col_vec_mat.mat','c','k','x');
 
 if ispc()
@@ -11,4 +11,4 @@ end
 c=c';
 k=k';
 x=x';
-save('ramst_initval_file_data_row_vec_mat.mat','c','k','x');
\ No newline at end of file
+save('ramst_initval_file_data_row_vec_mat.mat','c','k','x');
-- 
GitLab