From: Jim Procter Date: Mon, 22 Aug 2016 10:54:02 +0000 (+0100) Subject: JAL-2154 patch verifyAlignment so it fails for duplicate entries for same SequenceI... X-Git-Tag: Release_2_10_0~47^2~4^2~43^2~25 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=24883be7e7402b172bf83f438c807e58e8a10101;p=jalview.git JAL-2154 patch verifyAlignment so it fails for duplicate entries for same SequenceI instance on alignment --- 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())