From ee083bde159d83a51f7e562d3a88ad78c8a77617 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 27 Sep 2017 11:27:20 +0200 Subject: Add an assertion --- libcrystfel/src/index.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libcrystfel') diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c index a9b504fe..e4e3fc6a 100644 --- a/libcrystfel/src/index.c +++ b/libcrystfel/src/index.c @@ -517,6 +517,7 @@ static int try_indexer(struct image *image, IndexingMethod indm, { int i, r; int n_bad = 0; + int n_before = image->n_crystals; switch ( indm & INDEXING_METHOD_MASK ) { @@ -557,6 +558,9 @@ static int try_indexer(struct image *image, IndexingMethod indm, } + /* Stop a really difficult to debug situation in its tracks */ + assert(image->n_crystals - n_before == r); + /* For all the crystals found this time ... */ for ( i=0; i