Given a wrapper class around a foreign pointer:
class CObject private constructor(private val _internalCPointer: Long) {
external fun doACThing()
companion object {
external fun allocate(): CObject
}
}
mockK is generating instances of this object where _internalCPointer
is 0, leading to segfaults.
How can I tell mockK to use CObject.allocate
instead of the constructor?