test_engine: improve the test_stdout()