added tests for function optimization state