SCF*_*nch 5 c++ googletest googlemock
当我使用 Google Test 和 Google Mock 时,将诊断级别设置为“信息”,我收到如下消息:
Uninteresting mock function call - taking default action specified at:
src/pkgtest/test_Foo.cpp:216:
Function call: GetBar()
Returns: 4-byte object <00-00 00-00>
Stack trace:
Uninteresting mock function call - taking default action specified at:
src/pkgtest/test_Foo.cpp:126:
Function call: GetBaz()
Returns: {}
Stack trace:
unknown file: Failure
C++ exception with description "Uninteresting mock function call - returning default value.
Function call: CreateGrille(@0x7fff6a557050 { 16-byte object <80-D8 BB-01 00-00 00-00 70-D8 BB-01 00-00 00-00> })
The mock function has no default action set, and its return type has no default value set." thrown in the test body.
Run Code Online (Sandbox Code Playgroud)
我在互联网上找不到任何关于为什么 Google 测试/模拟不会打印堆栈跟踪或声称“未知文件”的信息。我需要做什么来教它如何正确转储堆栈跟踪?
(我在 Linux 上使用 g++ 4.9,如果这有区别的话。)
根据塞缪尔·本扎昆的说法:
gTest 不包括堆栈展开器。您必须提供自己的。您可以在 include/gtest/internal/custom/gtest.h 中通过定义 GTEST_OS_STACK_TRACE_GETTER_ 宏来指向 OsStackTraceGetterInterface 的实现来执行此操作。
https://groups.google.com/d/msg/googletestframework/WMJuxAE7y-A/3FjexkRpEQAJ
| 归档时间: |
|
| 查看次数: |
2490 次 |
| 最近记录: |