From 24883be7e7402b172bf83f438c807e58e8a10101 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 22 Aug 2016 11:54:02 +0100 Subject: [PATCH] JAL-2154 patch verifyAlignment so it fails for duplicate entries for same SequenceI instance on alignment --- test/jalview/datamodel/AlignmentTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/jalview/datamodel/AlignmentTest.java b/test/jalview/datamodel/AlignmentTest.java index dbecc20..379a9c5 100644 --- a/test/jalview/datamodel/AlignmentTest.java +++ b/test/jalview/datamodel/AlignmentTest.java @@ -178,9 +178,11 @@ public class AlignmentTest } else { + int dsp = -1; // verify all dataset sequences for (SequenceI seqds : alignment.getSequences()) { + dsp++; if (seqds.getDatasetSequence() != null) { if (raiseAssert) @@ -189,6 +191,18 @@ public class AlignmentTest } return false; } + int foundp = alignment.findIndex(seqds); + if (foundp != dsp) + { + if (raiseAssert) + { + Assert.fail(message + + " Dataset sequence array contains a reference at " + + dsp + " to a sequence first seen at " + foundp + " (" + + seqds.toString() + ")"); + } + return false; + } if (seqds.getDBRefs() != null) { for (DBRefEntry dbr : seqds.getDBRefs()) -- 1.7.10.2