test code for register