put testing code under #ifdef TEST