Rewrite unit tests in pure c