I asked you some time ago, if you knew any mocking frameworks, that work with criterion. Unfortunately, they were C++ only.
But I found a framework, that works with C and Criterion.
It's called cmock https://github.com/ThrowTheSwitch/CMock
Officially, it only supports Unity, but I made it work.
I can show you how, if you're interested.
They have some limited support for other xunit frameworks, so maybe we can make them work with criterion without patching stuff.