aboutsummaryrefslogtreecommitdiff
path: root/tests/list_check.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2013-07-24 16:47:21 +0200
committerThomas White <taw@physics.org>2013-07-24 16:47:21 +0200
commit0bb8df9b6a54db5da84d9fc9c26efcf5974fc89b (patch)
tree937cfe2c1e95324e52e474edbc219b0330a4cc78 /tests/list_check.c
parent863b0ddea31ff8dc0d789f2806c6a311d826a152 (diff)
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).
Diffstat (limited to 'tests/list_check.c')
-rw-r--r--tests/list_check.c11
1 files changed, 8 insertions, 3 deletions
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 <taw@physics.org>
+ * Copyright © 2012-2013 Deutsches Elektronen-Synchrotron DESY,
+ * a research centre of the Helmholtz Association.
+ *
+ * Authors:
+ * 2011-2013 Thomas White <taw@physics.org>
*
* 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;
}
}