modify test_mem.c and add new file ttool.c