GoogleTest C ++应用程序在定义方法时崩溃

我正在使用CMake在Visual Studio 2017下开发GoogleTest应用程序。

以下代码进行编译和链接,但是如果定义了任何测试,则在TEST宏上引发std :: bad_alloc异常。

#include <gtest/gtest.h>

TEST(WasapiSource_Test,test) {  // <--- Crashes here with std::bad_alloc
}

int main(int argc,char** argv) {
    ::testing::InitGoogleTest(&argc,argv);
    return RUN_ALL_TESTS();
}

为测试重新启动,应用程序将正常运行。

nidi_3 回答:GoogleTest C ++应用程序在定义方法时崩溃

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3157155.html

大家都在问