adds self tests for state_machine