add test function in ifmain