Refactored C tests