From 013c762b667a0fede74377cb0f9799d3b3262640 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 28 Jul 2020 14:46:19 +0200 Subject: Expose a couple more functions for easier testing --- libcrystfel/src/integration.c | 11 +++++------ libcrystfel/src/peaks.c | 12 ++++++------ tests/CMakeLists.txt | 4 ---- tests/prof2d_check.c | 10 +++++++++- tests/ring_check.c | 7 ++++++- 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 #include +#include +#include +#include +#include #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 #include -#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. */ -- cgit v1.2.3