我正在使用Google Test断言某些错误代码会出现,而且这些错误代码始终是十六进制常量。所以这个输出不太理想:
mytest.cpp第130行及其输出:
EXPECT_EQ(0xBFFF0011, error) << "Expected second close to return an error";
[ RUN ] MyTest.CloseSessionFail
mytest.cpp(130): error: Value of: error
Actual: -1074130544
Expected: 0xBFFF0011
Which is: 3221159953
Expected second close to return an error
对于EXPECT_EQ(期望的,实际的),是否有某种方法可以使其格式化十六进制输出?
理想情况下,我想看到这个:
Actual: 0xBFFA1190
Expected: 0xBFFF0011