2

我正在使用 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(expected, actual),有没有办法让它格式化十六进制输出?

理想情况下,我希望看到这个:

  Actual: 0xBFFA1190
Expected: 0xBFFF0011
4

1 回答 1

0

这条消息可能会对您有所帮助: https ://github.com/google/googletest/issues/222

于 2016-06-02T13:24:50.260 回答