test state transition and reset