Added test function to test.c