CSAFE-ISU / handwriter

Forensic Handwriting Analysis Pipeline in R - Please download our stable version from CRAN using 'install.packages("handwriter")'
https://csafe-isu.github.io/handwriter/
GNU Affero General Public License v3.0
24 stars 9 forks source link

fix test of getGraphInfo_cpp #143

Closed ahgamut closed 5 months ago

ahgamut commented 5 months ago

the test function for getGraphInfo_cpp was producing an error with respect to matrix-conversion, specifically for:

Rcpp was throwing an error when trying to convert an element of pathEndsrc into a matrix.

upon closer study, we found that the function initializing the dummy image_list values for the test specified pathEndsrc as an array, while the actual handwriter code always specifies pathEndsrc as a list -- when searching through the handwriter code, we found pathEndsrc was always created via lapply.

the assumption made in the RCpp code is that pathEndsrc is a list of 2x2 matrices, and this assumption was only found to be violated in the testcases. Hence, we patch the test function to ensure pathEndsrc is a list everywhere.