add main.c file and implement test function.