void dotest(const char* opName, Asm& a, void (Asm::*memFn)(Arg)) { std::vector<std::string> expecteds; auto& args = Gen<Arg>::gen(); for (auto& ar : args) { expecteds.push_back(expected_str(ar)); (a.*memFn)(ar); } auto const dump = dump_disasm(a); compare(opName, dump, expecteds); a.clear(); }
void dotest(const char* opName, Asm& a, void (Asm::*memFn)(Arg1, Arg2), const std::vector<Arg1>& args1, const std::vector<Arg2>& args2) { std::vector<std::string> expecteds; for (auto& ar1 : args1) { for (auto& ar2 : args2) { expecteds.push_back( folly::format("{}, {}", expected_str(ar1), expected_str(ar2)).str() ); (a.*memFn)(ar1, ar2); } } auto const dump = dump_disasm(a); compare(opName, dump, expecteds); a.clear(); }
void dotest(const char* opName, Asm& a, void (Asm::*memFn)(Arg1, Arg2), const std::vector<Arg1>& args1, const std::vector<Arg2>& args2) { std::vector<std::string> expecteds; for (auto& ar1 : args1) { for (auto& ar2 : args2) { expecteds.push_back(str( boost::format("%s,%s") % expected_str(ar1) % expected_str(ar2) )); (a.*memFn)(ar1, ar2); } } std::ifstream dump; dump_disasm(a, dump); compare(opName, dump, expecteds); a.clear(); }