aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/index.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-09-27 11:27:20 +0200
committerThomas White <taw@physics.org>2017-09-27 11:27:20 +0200
commitee083bde159d83a51f7e562d3a88ad78c8a77617 (patch)
treecd342bdcebb44af64cd5b89a9b20a4333fef1282 /libcrystfel/src/index.c
parente0abfde832a4fc3c591edc1631a71cdf03a5c1ee (diff)
Add an assertion
Diffstat (limited to 'libcrystfel/src/index.c')
-rw-r--r--libcrystfel/src/index.c4
1 files changed, 4 insertions, 0 deletions
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<r; i++ ) {