refactor ctype_tests.c