Ex post tests for short-and long-run optimization