0

我正在使用 Visual Studio 2012 的 CppUnitTestFramework 对我的 c++ 代码进行单元测试。现在我想使用 Visual Leak Detector 检查内存泄漏。所以我把

#include "vld.h"

进入我的测试类文件。我添加了类似的东西

new MyClass();

到“模拟”内存泄漏的测试方法。

一切编译和链接都很好,这意味着指定了 VLD 目录。但是测试崩溃了:

------ Run test started ------
The active Test Run was aborted because the execution process exited unexpectedly. To investigate further, enable local crash dumps either at the machine level or for process vstest.executionengine.x86.exe. Go to more details: http://go.microsoft.com/fwlink/?linkid=232477
========== Run test finished: 0 run (0:00:02,3841194) ==========

当我删除包含指令时,测试成功通过。有没有办法将 VLD 与 Visual Studio 测试框架一起启用?

4

1 回答 1

1

我有一个类似的问题,通过将 vld bin 目录中的 Microsoft.DTfW.DHL.manifest 复制到单元测试可执行目录来解决。

于 2013-05-02T14:51:52.207 回答