From 38fe128e368cc3031e024da5cc0bfdc1e7ff2d38 Mon Sep 17 00:00:00 2001
From: joanvallve <jvallve@iri.upc.edu>
Date: Tue, 13 Apr 2021 10:45:10 +0200
Subject: [PATCH] added assert checking correct user input for prior_mode

---
 src/problem/problem.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/problem/problem.cpp b/src/problem/problem.cpp
index 0bb18fd52..9c939355a 100644
--- a/src/problem/problem.cpp
+++ b/src/problem/problem.cpp
@@ -176,6 +176,7 @@ ProblemPtr Problem::autoSetup(ParamsServer &_server)
 
     // Prior
     std::string prior_mode = _server.getParam<std::string>("problem/prior/mode");
+    assert((prior_mode == "nothing" || prior_mode == "initial_guess" || prior_mode == "fix" || prior_mode == "factor") && "wrong _mode value, it should be: 'nothing', 'initial_guess', 'fix' or 'factor'");
     WOLF_TRACE("Prior mode: ", prior_mode);
     if (prior_mode == "nothing")
     {
-- 
GitLab