The test framework uses static global variables to minimize unnecessarily reading the input datasets. However, there is an underlying assumption that all tests involving the mocks datasets are done sequentially (i.e. all DD type tests are done before any DR or RR tests). This assumption was not made explicit or checked within the tests_*.c codes. Now, the current implementation bug has now been exposed by PR #132 and this issue should be fixed before #132 can be merged into master.
Best way to fix the issue would be to setup an init_read_positions with a list of input files and their file formats and read them all in into a variables. Then an additional function takes in the list of files required for any particular test and assigns the correct datasets into (ND1/X1/Y1/Z1, ND2/X2/Y2/Z2) and (ND1/RA1/DEC1/CZ1, ND2/RA2/DEC2/CZ2). Also needs a new free_positions function to free up the memory allocated in init_read_positions.
The test framework uses
static
global variables to minimize unnecessarily reading the input datasets. However, there is an underlying assumption that all tests involving themocks
datasets are done sequentially (i.e. allDD
type tests are done before anyDR
orRR
tests). This assumption was not made explicit or checked within thetests_*.c
codes. Now, the current implementation bug has now been exposed by PR #132 and this issue should be fixed before #132 can be merged intomaster
.Best way to fix the issue would be to setup an
init_read_positions
with a list of input files and their file formats and read them all in into a variables. Then an additional function takes in the list of files required for any particular test and assigns the correct datasets into (ND1/X1/Y1/Z1
,ND2/X2/Y2/Z2
) and (ND1/RA1/DEC1/CZ1
,ND2/RA2/DEC2/CZ2
). Also needs a newfree_positions
function to free up the memory allocated ininit_read_positions
.