I'm just starting to learn the CppUnitTest framework and I'm having the weirdest problem. When I'm running my code (see bellow) it just stuck forever, however - if I'm adding a breakpoint and running it as "step-by-step" the test finish successfully (although it doesn't free the DLL of the test)
namespace CalibrationUnitTest
{
static SCreateDirectoriesParams* createDirectoriesParams;
TEST_CLASS(CreateDirectoryTest)
{
public:
TEST_CLASS_INITIALIZE(ClassInitialize)
{
createDirectoriesParams = new SCreateDirectoriesParams;
}
TEST_METHOD(CreateDirectoriesRegressionTest)
{
strcpy_s(createDirectoriesParams->rootPath, MAX_PATH_SIZE, "c:\\tmp");
Assert::AreEqual(CreateDirectories(*createDirectoriesParams), SUCCESS);
}
TEST_CLASS_CLEANUP(ClassCleanUp)
{
delete(createDirectoriesParams);
}
};
}
I tried to search for this problem for the last 2 days without any success, and I'll be glad for any help!
EDIT: it seems that the test stuck when I try to call any of my API functions, and when I put it in comment the test pass also in regular run.