From 0bb8df9b6a54db5da84d9fc9c26efcf5974fc89b Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 24 Jul 2013 16:47:21 +0200 Subject: Iteration over reflection list should include other reflections with same asymmetric indices This fixes a >2 year old bug in the reflection list, and a bug in tests/list_check.c which allowed it to go undetected for so long. The main situation where it would have caused problems is when asymmetric_indices() was called on a reflection list containing symmetrically equivalent reflections. The only core CrystFEL program which does this is partialator. compare_hkl uses asymmetric_indices(), but the reflections are already guaranteed to be asymmetric by that point (because check_list_symmetry() has been called). --- tests/list_check.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/list_check.c b/tests/list_check.c index b1b8814d..9656dd1a 100644 --- a/tests/list_check.c +++ b/tests/list_check.c @@ -3,7 +3,11 @@ * * Unit test for the reflection list module * - * Copyright © 2012 Thomas White + * Copyright © 2012-2013 Deutsches Elektronen-Synchrotron DESY, + * a research centre of the Helmholtz Association. + * + * Authors: + * 2011-2013 Thomas White * * This file is part of CrystFEL. * @@ -99,8 +103,8 @@ static int test_lists(int num_items) } - printf("num_reflections is %i, tree depth is %i\n", - num_reflections(list), tree_depth(list)); + printf("Created %i items, num_reflections is %i, tree depth is %i\n", + num_items, num_reflections(list), tree_depth(list)); /* Iterate over the list and check we find everything */ int count = 0; @@ -118,6 +122,7 @@ static int test_lists(int num_items) && (check[i].l == l) && (check[i].found == 0) ) { check[i].found = 1; + break; } } -- cgit v1.2.3