How to add a timeout for a C ++ test method in testing Microsoft modules using CppUnitTestFramework? Most of the solutions I found on the Internet are for CSharp projects where I can add lines like [TEST_METHOD, TIME_OUT (80)] or such, but they do not work during testing C ++ code (VC ++)
I tried the code below
#include "stdafx.h"
#include "CppUnitTest.h"
#include "../src/factorial_dp.cpp"
#include "stdio.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace spec
{
TEST_CLASS(factorial_dpSpec)
{
public:
TEST_METHOD(Smallnumber)
{
int result = fact(5);
Assert::AreEqual(120, result, L"5 fact should be 120", LINE_INFO());
}
};
}
source
share