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
}
};
}