Google UT 失败

Failure in Google 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 test adapter plugin), remember that you CAN debug those tests and that you can enable the capture of run time exections (they are not captured by default). The answer given to a similar question 可能会对您有所帮助。

无论如何,如果我不得不猜测,我会怀疑对空指针的访问是您麻烦的根源。