testing state machine