I am using Tensorflow Lite API in C to infer results from a model file, for which code is written in a .c file across different functions. The functions include get_interpreter which creates a new interpreter, etc.
Now, this is all in C code. I am calling this C function in Go using CGo support in Go.
Go function (pseudocode):
package main
import "C"
func callCApi() error {
// load data
// get_interpreter returns an interpreter of type TfLiteInterpreter*
interpreter = C.get_interpreter(param1, param2)
// run inference
// errors are returned if any during the above stages, else nil is returned
return nil
}
I want to unit test the above Go code callCApi(), how do I achieve this?
I understand that the above C function get_interpreter must be mocked; how can this be mocked?