aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-07-28 14:46:19 +0200
committerThomas White <taw@physics.org>2020-07-29 18:53:45 +0200
commit013c762b667a0fede74377cb0f9799d3b3262640 (patch)
tree7959944636531421246917a81226321f9bab5eca
parent4ac5b40dd5f7e4dadf98fa85408ca9230c3d7dbb (diff)
Expose a couple more functions for easier testing
-rw-r--r--libcrystfel/src/integration.c11
-rw-r--r--libcrystfel/src/peaks.c12
-rw-r--r--tests/CMakeLists.txt4
-rw-r--r--tests/prof2d_check.c10
-rw-r--r--tests/ring_check.c7
5 files changed, 26 insertions, 18 deletions
diff --git a/libcrystfel/src/integration.c b/libcrystfel/src/integration.c
index 3c1dba0d..8f81dc10 100644
--- a/libcrystfel/src/integration.c
+++ b/libcrystfel/src/integration.c
@@ -1372,11 +1372,11 @@ static void setup_profile_boxes(struct intcontext *ic, RefList *list)
}
-static void integrate_prof2d(IntegrationMethod meth,
- Crystal *cr, struct image *image, IntDiag int_diag,
- signed int idh, signed int idk, signed int idl,
- double ir_inn, double ir_mid, double ir_out,
- pthread_mutex_t *term_lock, int **masks)
+void integrate_prof2d(IntegrationMethod meth,
+ Crystal *cr, struct image *image, IntDiag int_diag,
+ signed int idh, signed int idk, signed int idl,
+ double ir_inn, double ir_mid, double ir_out,
+ pthread_mutex_t *term_lock, int **masks)
{
RefList *list;
UnitCell *cell;
@@ -1855,4 +1855,3 @@ IntegrationMethod integration_method(const char *str, int *err)
return meth;
}
-
diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c
index 22f2e7b7..854eaf39 100644
--- a/libcrystfel/src/peaks.c
+++ b/libcrystfel/src/peaks.c
@@ -133,12 +133,12 @@ int *make_BgMask(struct image *image, struct detgeom_panel *p,
/* Returns non-zero if peak has been vetoed.
* i.e. don't use result if return value is not zero. */
-static int integrate_peak(struct image *image,
- int p_cfs, int p_css, int pn,
- double *pfs, double *pss,
- double *intensity, double *sigma,
- double ir_inn, double ir_mid, double ir_out,
- int *saturated)
+int integrate_peak(struct image *image,
+ int p_cfs, int p_css, int pn,
+ double *pfs, double *pss,
+ double *intensity, double *sigma,
+ double ir_inn, double ir_mid, double ir_out,
+ int *saturated)
{
signed int dfs, dss;
double lim_sq, out_lim_sq, mid_lim_sq;
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 799e43eb..01abe3eb 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -51,10 +51,6 @@ add_test(prof2d_check prof2d_check)
add_executable(ring_check ring_check.c)
target_include_directories(ring_check PRIVATE ${COMMON_INCLUDES})
target_link_libraries(ring_check PRIVATE ${COMMON_LIBRARIES})
-if (FDIP_FOUND)
- target_include_directories(ring_check PRIVATE ${FDIP_INCLUDES})
- target_link_libraries(ring_check PRIVATE ${FDIP_LIBRARIES})
-endif (FDIP_FOUND)
add_test(ring_check ring_check)
add_executable(symmetry_check symmetry_check.c)
diff --git a/tests/prof2d_check.c b/tests/prof2d_check.c
index f291c915..28ecd67c 100644
--- a/tests/prof2d_check.c
+++ b/tests/prof2d_check.c
@@ -31,10 +31,18 @@
#include <image.h>
#include <utils.h>
+#include <cell.h>
+#include <cell-utils.h>
+#include <geometry.h>
+#include <integration.h>
#include "histogram.h"
-#include "../libcrystfel/src/integration.c"
+extern void integrate_prof2d(IntegrationMethod meth,
+ Crystal *cr, struct image *image, IntDiag int_diag,
+ signed int idh, signed int idk, signed int idl,
+ double ir_inn, double ir_mid, double ir_out,
+ pthread_mutex_t *term_lock, int **masks);
#define ADD_PX(fs, ss, val) \
diff --git a/tests/ring_check.c b/tests/ring_check.c
index dac0d90f..f4830068 100644
--- a/tests/ring_check.c
+++ b/tests/ring_check.c
@@ -33,8 +33,13 @@
#include <image.h>
#include <utils.h>
-#include "../libcrystfel/src/peaks.c"
+extern int integrate_peak(struct image *image,
+ int p_cfs, int p_css, int pn,
+ double *pfs, double *pss,
+ double *intensity, double *sigma,
+ double ir_inn, double ir_mid, double ir_out,
+ int *saturated);
/* The third integration check draws a Poisson background and checks that, on
* average, it gets subtracted by the background subtraction. */