bench_engine: refactor most tests in a single function