0
我只是在新的解决方案中设置了一个新的(本地)单元测试。但是,即使示例程序不起作用,如果我添加一个断言。它编译没有问题,并且默认生成(空)测试成功。但是,当我添加一个简单的断言时,它会失败,错误代码为C0000005。Visual Studio(2013)单元测试失败C0000005
这可能与similar issue有关,但我甚至没有连接某个库,因此无法使用建议的解决方案。
测试看起来是这样的:
#include "stdafx.h"
#include "CppUnitTest.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace Test_Native
{
TEST_CLASS(UnitTest1)
{
public:
TEST_METHOD(TestMethod1)
{
Assert::AreEqual(1, 1, L"message", LINE_INFO()); // Without this line everything is fine
// TODO: Your test code here
}
};
}