unit-testing - 谷歌UT失败
问题描述
[----------] 2 tests from VideoMgrTest
[Blast] Log directory is: C:\ProgramData\VMware\VMware Blast
[ RUN ] VideoMgrTest.createVideoMgr
unknown file: error: SEH exception with code 0xc0000005 thrown in TearDown().
[ FAILED ] VideoMgrTest.createVideoMgr (1 ms)
[ RUN ] VideoMgrTest.getFBAddress
unknown file: error: SEH exception with code 0x5 thrown in the test body.
[ FAILED ] VideoMgrTest.getFBAddress (3 ms)
[----------] 2 tests from VideoMgrTest (8 ms total)
[----------] Global test environment tear-down
[==========] 10 tests from 4 test cases ran. (226 ms total)
[ PASSED ] 8 tests.
[ FAILED ] 2 tests, listed below:
[ FAILED ] VideoMgrTest.createVideoMgr
[ FAILED ] VideoMgrTest.getFBAddress
我在 Google UT 中遇到了失败。我提供了如下给出的函数定义。Ita 因 SEG 异常而失败。我知道访问被拒绝,但我不知道正在访问什么
void VideoMgrTest::TearDown()
{
VideoProducerInstance::DestroyInstance();
mVideoMgr = NULL;
}
解决方案
运行时异常很难确定,不幸的是,您提供的代码片段不足以提供任何帮助。
如果您使用 Visual Studio 来运行您的单元测试(例如使用google 测试适配器插件),请记住您可以调试这些测试并且您可以启用运行时执行的捕获(默认情况下不会捕获它们)。在这里给出的类似问题的答案可能对您有所帮助。
无论如何,如果我不得不猜测,我怀疑空指针的访问是你麻烦的根源。
推荐阅读
- docker - 什么是使用 kubernetes pod 挂载文件夹?
- java - 如何使用 bytebuddy 拦截 Java 中的“同步”代码块?
- c - 转到特定元素 C
- primefaces - Primefaces 的问题与更新属性确认对话框
- google-chrome - 认知 CITS 测试通过 Bamboo 运行:“接收来自渲染器的消息超时”
- python - 将 str 分数转换为 pandas df 中的浮点数
- python - 具有不同值类型的 Python3 输入
- powerbi - Power BI 数据类型
- excel-formula - 我正在尝试制作一个excel公式,从列中的最后一个数字中减去列中的倒数第二个数字
- java - Java 文档注释未完全显示