From 503f1f3d577fb856efa01d497353958b92474a71 Mon Sep 17 00:00:00 2001
From: David Parsons <david.parsons@inria.fr>
Date: Tue, 12 Dec 2023 18:38:09 +0100
Subject: [PATCH] TMP! add debug failure output + exit

---
 src/libaevol/7/Dna_7.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/libaevol/7/Dna_7.cpp b/src/libaevol/7/Dna_7.cpp
index 6fb30c5d9..33084f827 100644
--- a/src/libaevol/7/Dna_7.cpp
+++ b/src/libaevol/7/Dna_7.cpp
@@ -34,6 +34,8 @@
 #include "legacy/ExpManager.h"
 #include "ExpManager_7.h"
 
+#include <cassert>
+
 #define REDUCTION_FACTOR 16
 
 namespace aevol {
@@ -346,6 +348,12 @@ Mutation* Dna_7::do_duplication(size_type pos_1, size_type pos_2, size_type pos_
 
   }
   else { // if (pos_1 >= pos_2)
+    #ifdef __EUKARYOTE
+      std::cout << "*** Invalid duplicated segment for linear chromosomes *** \n";
+      std::cout << " pos1 : " << pos_1 << " and pos2: " << pos_2 << " should be inverted" << std::endl;
+      assert(false);
+    #endif
+
     // The segment to duplicate includes the origin of replication.
     // The copying process will be done in two steps.
     //
-- 
GitLab