我已经使用我制作的结构作为参数值编写了Parameterized Gtest。当测试失败时,它将像这样写一个struct的字节对象:
[ FAILED ] RulesNoProcessing/StressTest.MainTest/2, where GetParam() =
40-byte object <01-12 00-00 02-00 00-00 F4-01 00-00 ...>.
反正我可以自定义输出吗?我知道断言有谓词格式,但我需要对测试的实际结果进行类似的操作。如果有人可以帮忙,我将不胜感激!
例如,您必须重写“运算符<
struct Row
{
int window;
int osmap;
friend std::ostream& operator<<(std::ostream& os, const Row& bar) {
return os << "w = " << bar.window << ", opsmap= " << bar.osmap; // whatever needed to print
}
};