add unit_test function in main.c
port malloc function