test validation code